Skip to content

Releases: ccpaging/nxlog4go

v2.0.3

28 Nov 16:21
667ece8
Compare
Choose a tag to compare

Drivered

Prepared for upgrading version 2.0

13 Dec 17:01
Compare
Choose a tag to compare
Pre-release
v1.0.4

code smell

Entry

13 Nov 14:56
Compare
Choose a tag to compare
Entry Pre-release
Pre-release
  • 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(...)

28 Feb 16:02
268121c
Compare
Choose a tag to compare
Support log.With(...) Pre-release
Pre-release

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

21 Feb 06:40
Compare
Choose a tag to compare
Bug fixed Pre-release
Pre-release
  • 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 to logging.go

Todo

  • Support log.Debug.With(key, valure).Info("message")

Compatible with go std log lib

19 Feb 08:20
Compare
Choose a tag to compare
Pre-release
v0.9.2

Using sync.Once