Nxlog4go Versions Save

Next logging package for the Go programming language based on log4go, std log lib, logrus, uber zap

v2.0.3

3 years ago

Drivered

v1.0.4

4 years ago

v1.0.1

4 years ago
  • 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...

v0.9.4

5 years ago

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

v0.9.3

5 years ago
  • 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")

v0.9.2

5 years ago