mirror of
https://github.com/cgzirim/seek-tune.git
synced 2025-12-18 09:24:19 +00:00
remove main function from logger
This commit is contained in:
parent
6ac1e0ca46
commit
eb95c12802
1 changed files with 0 additions and 15 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
@ -82,17 +81,3 @@ func GetLogger() *slog.Logger {
|
||||||
logger := slog.New(h)
|
logger := slog.New(h)
|
||||||
return logger
|
return logger
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
|
||||||
h := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
|
|
||||||
ReplaceAttr: replaceAttr,
|
|
||||||
})
|
|
||||||
|
|
||||||
logger := slog.New(h)
|
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
|
|
||||||
err := xerrors.New("something happened")
|
|
||||||
|
|
||||||
logger.ErrorContext(ctx, "image uploaded", slog.Any("error", err))
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue