Documentation ¶
Overview ¶
Example ¶
package main import ( "github.com/helloh2o/lucky/log" l "log" ) func main() { name := "Leaf" log.Debug("My name is %v", name) log.Release("My name is %v", name) log.Error("My name is %v", name) // log.Fatal("My name is %v", name) logger, err := log.New("release", "", l.LstdFlags) if err != nil { return } defer logger.Close() logger.Debug("will not print") logger.Release("My name is %v", name) log.Export(logger) log.Debug("will not print") log.Release("My name is %v", name) }
Output:
Index ¶
- func Close()
- func Debug(a ...interface{})
- func Error(a ...interface{})
- func Export(logger *Logger)
- func Fatal(a ...interface{})
- func Release(a ...interface{})
- func SetLogLevelDefault(lv string)
- func Warn(a ...interface{})
- type Logger
- func (logger *Logger) Close()
- func (logger *Logger) Debug(a ...interface{})
- func (logger *Logger) Error(a ...interface{})
- func (logger *Logger) Fatal(a ...interface{})
- func (logger *Logger) GetOutputLv() int
- func (logger *Logger) Release(a ...interface{})
- func (logger *Logger) SetLogLevel(strLevel string)
- func (logger *Logger) Warn(a ...interface{})
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogLevelDefault ¶ added in v1.2.7
func SetLogLevelDefault(lv string)
Types ¶
Click to show internal directories.
Click to hide internal directories.