Logging
Small Golang package to output alternative logs
Installation
go get code.afis.me/logging
Example
package main
import (
"code.afis.me/logging"
)
var logger *logging.Logger
var maxlogsize int64 = 10000
func init() {
logger := logging.NewLogger("test", []string{"/code.afis.me/logging/"})
store := logging.NewLogsStore(maxlogsize)
logger.OutputHandler = func(ps *logging.PushLogs) {
store.Store(true, ps.ID, ps)
}
}
func main() {
err := fmt.Errorf("Hello")
logger.Error(err)
logger.Error(err).Quit(err)
logger.Debug("Hello from golang")
logger.Warning("Hello from golang")
logger.Success("Hello from golang")
}