Releases: gonyyi/alog
Releases · gonyyi/alog
v1.0.0 Release
This is a first 1.0.0 release.
// Create a tag "Disk"
// Create a tag "DB"
tagDisk := al.NewTag("Disk")
tagDB := al.NewTag("DB")
al.Info(tagDisk).Str("action", "reading disk").Write()
al.Info(tagDB).Str("id", "myID").Str("pwd", "myPasswd").Writes("Login") // Anything in `Write(string)` will be printed as `message`.
al.Info(tagDisk,tagDB).Int("status", 200).Writes("Login")
al.Info(tagDisk|tagDB).Int("status", 200).Writes("Logout") // tags can be used as `tagDisk|tagDB` or `tagDisk,tagDB` format
// Output:
// {"date":20210308,"time":203835,"level":"info","tag":["Disk"],"action":"reading disk"}
// {"date":20210308,"time":203835,"level":"info","tag":["DB"],"message":"Login","id":"myID","pwd":"myPasswd"}
// {"date":20210308,"time":203835,"level":"info","tag":["Disk","DB"],"message":"Login","status":200}
// {"date":20210308,"time":203835,"level":"info","tag":["Disk","DB"],"message":"Logout","status":200}Added *logger.Log
v0.8.3 Added *logger.Log
Tag now has method Has, Sub
v0.8.2 Update tag_test.go
0.8.1 release - NewWriterFn() added
NewWriterFn() can be used for conditional outputs of logger such as certain tag and/or level to be recorded to different writers.
0.8.0 release
- Fixed bug with ext.Formatter when
Write("") - Added
alog.Errtype - Use Zerolog's AppendString (see appendString.go)
Err(string, error)now takesErr(error)and "error" will be used as a default key.Write(string)now takesWrite(...string)to be optional
Require arguments for *Logger.Write(string)
Previous varargs mislead how it supposed to work.
Use alog.Discard instead of io.Discard for backward compatibility
v0.7.6 Update README.md
logger.Ext.Init() update to take Control's pointer, etc.
Also added examples
Changes in Ext method names. Updated readme.
v0.7.4 Update readme
Fix: Const UseDefault -> WithDefault
v0.7.3 Update logger_mode.go