log

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 7 Imported by: 201

README

ion-log

QuickStart

package main

import (
	log "github.com/pion/ion-log"
)

func init() {
	fixByFile := []string{"asm_amd64.s", "proc.go"}
	fixByFunc := []string{}
	log.Init("debug", fixByFile, fixByFunc)
}

func main() {
	log.Infof("Hello ION!")
}

Feature

  • GoodFormat: [date time] [Level] [Line][File][Func] => YourLog
 [2020-11-04 16:13:54.593] [INFO] [14][main.go][main] => Hello ION!
  • FixByHand: you can fixByFile or fixByFunc when you found the log line not right

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(format string, v ...interface{})

Debugf logs a formatted debug level log to the console

func Errorf

func Errorf(format string, v ...interface{})

Errorf logs a formatted error level log to the console

func Infof

func Infof(format string, v ...interface{})

Infof logs a formatted info level log to the console

func Init

func Init(level string, fixByFile, fixByFunc []string)

Init initializes the package logger. Supported levels are: ["debug", "info", "warn", "error"]

func Panicf

func Panicf(format string, v ...interface{})

Panicf logs a formatted panic level log to the console. The panic() function is called, which stops the ordinary flow of a goroutine.

func Tracef

func Tracef(format string, v ...interface{})

Tracef logs a formatted debug level log to the console

func Warnf

func Warnf(format string, v ...interface{})

Warnf logs a formatted warn level log to the console

Types

type Config

type Config struct {
	Level string `mapstructure:"level"`
}

Config defines parameters for the logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL