Logs messages to a database table.
go get -u github.com/gouniverse/logstore
logStore, err = logstore.NewStore(logstore.NewStoreOptions{
DB: databaseInstance,
LogTableName: "log",
AutomigrateEnabled: true,
})
if err != nil {
panic(error.Error())
}
logStore.Info("Hello")
- LevelTrace - Something very low level
- LevelDebug - Useful debugging information
- LevelInfo - Something noteworthy happened!
- LevelWarn - You should probably take a look at this
- LevelError - Something failed but I'm not quitting
- LevelFatal - Bye. Calls os.Exit(1) after logging
- LevelPanic - I'm bailing. Calls panic() after logging
2023.07.19 - Updated instance creation to use options struct
2022.06.26 - Updated dependencies
2021.12.21 - Added LICENSE
2021.12.21 - Added test badge
2021.12.21 - Added support for DB dialects
2021.12.21 - Removed GORM dependency and moved to the standard library