Skip to content

An attempt to implement Go console logger by wrapping `zerolog` module

Notifications You must be signed in to change notification settings

ipitsyn/myZerolog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

myZeroLog

An attempt to implement Go console logger by wrapping zerolog module.

Implements commonly used Logger interface methods:

  • Trace / Tracef
  • Debug / Debugf
  • Info / Infof
  • Warn / Warnf
  • Error / Errorf
  • Panic / Panicf
  • Fatal / Fatalf

NB! Test results

It is actually slower than the zap sugared logger :-(
Even with the buffered io.Writer. Most likely because zerolog's ConsoleWriter produce the line to be written from the JSON, so assembling / disassembling JSON is what brings overhead here.

15:44:09.277 WRN [         test.go:090] myZerolog speed: 121321.515 operations per second
15:44:09.277 WRN [         test.go:091] ZapSugar speed: 147570.394 operations per second

About

An attempt to implement Go console logger by wrapping `zerolog` module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published