Releases: ccpaging/nxlog4go
Releases · ccpaging/nxlog4go
v2.0.3
Prepared for upgrading version 2.0
v1.0.4 code smell
Entry
-
About Entry
// A Entry contains all of the pertinent information for each message // It is the final or intermediate logging entry also. It contains all // the fields passed with WithField{,s}. It's finally logged when Trace, Debug, // Info, Warn, Error, Fatal or Panic is called on it. type Entry struct { Level int // The log level Created time.Time // The time at which the log message was created (nanoseconds) Prefix string // The message prefix Source string // The message source Line int // The source line Message string // The log message Data map[string]interface{} // Contains all the fields set by the user. }
- Support log.With(key1, val1, key2, val2...).Info(format, v1, v2, v3...)
- Support entry.Info(message, key1, val1, key2, val2...)
-
Version 2.0 is comming soon...
Support log.With(...)
Changelog
-
LogRecord changes to:
type LogRecord struct { logger *Logger Level Level // The log level Created time.Time // The time at which the log message was created (nanoseconds) Prefix string // The prefix Source string // The source Line int // The source line Message string // The log message Data map[string]interface{} // Contains all the fields set by the user. }
- Add *Logger
- Add Data map
- Support Logger.With(args ...interface{})
- Support LogRecord.With(args ...interface{})
-
LoadConfiguration return []error
-
Layout new pattern:
- %F - Data in "key=value" format
- %J - Data in JSON format
-
nxlog4go_test.go separates into a few test files
Todo
- Moving Logger's prefix to LogRecord
Bug fixed
-
Bug fixed.
Using "func (l Logger)" caused mu.Lock() not working. Changes to "func (l *Logger)".
-
Arguments change.
'func (l Logger) Log(calldepth int, lvl Level, message string)'
is changed to:
'func (l *Logger) Log(level Level, args ...interface{})'
func (l Logger) Debug(arg0 interface{}, args ...interface{})
is changed to:
func (l *Logger) Debug(args ...interface{})
-
wrapper.go
is renamed tologging.go
Todo
- Support
log.Debug.With(key, valure).Info("message")
Compatible with go std log lib
v0.9.2 Using sync.Once