Log

See the log concepts for details.

How to bootstrap letslog?

Define a severity level in .env. Debug is default.

LOG_LEVEL=debug

Call InitLogFuncs() in main.go

package main

import (
    ...
    "github.com/letsgo-framework/letsgo/letslog"
    ...
)


func main() {
    ...
    ...
    letslog.InitLogFuncs()
    ...
}

Write log

greet := "Hello log"
letslog.Debug("%s from letsgo", greet)

View log: you can manually open ./log/letsgo.log or run

letsgo-cli log 50