Skip to content

Releases: dyweb/gommon

Structured logging w/ cli & json handler and source line

06 Feb 01:43
e5dc69a
Compare
Choose a tag to compare

Mostly from #44

  • support source line using runtime, code generation #43 is too complex for now
  • json format, manually concat bytes slice w/o using encoding/json and bytes.Buffer
  • cli handler, color with delta time, delta time is using custom formatNum instead of fmt.Printf('%04d')
  • introduced color package, though it's in util as a sub package

Support go template in generator

05 Feb 00:06
e135d12
Compare
Choose a tag to compare

The generator package now can

  • generate methods to meet the strange log.LoggableStruct interface
  • port support of go template from Ayi, previously logging level in log package is generated by Ayi gotmpl, now its part of gommon generate and defined in gommon.yml without passing data in command line flag
  • gommon generate is using go's built in flag package, instead of cobra, go's flag package is not very handy