parent
ae4501ae21
commit
f75188b412
51 changed files with 4048 additions and 231 deletions
src/logwrap
32
src/logwrap/log.go
Normal file
32
src/logwrap/log.go
Normal file
|
@ -0,0 +1,32 @@
|
|||
package logwrap
|
||||
|
||||
const FileName = "tstor.log"
|
||||
|
||||
// func Load(config *config.Log) {
|
||||
// level := slog.LevelInfo
|
||||
// if config.Debug {
|
||||
// level = slog.LevelDebug
|
||||
// }
|
||||
|
||||
// slog.SetDefault(slog.New(
|
||||
// tint.NewHandler(os.Stdout, &tint.Options{
|
||||
// Level: level,
|
||||
// TimeFormat: time.Kitchen,
|
||||
// // NoColor: !isatty.IsTerminal(os.Stdout.Fd()),
|
||||
// }),
|
||||
// ))
|
||||
// }
|
||||
|
||||
// func newRollingFile(config *config.Log) io.Writer {
|
||||
// if err := os.MkdirAll(config.Path, 0744); err != nil {
|
||||
// log.Error().Err(err).Str("path", config.Path).Msg("can't create log directory")
|
||||
// return nil
|
||||
// }
|
||||
|
||||
// return &lumberjack.Logger{
|
||||
// Filename: filepath.Join(config.Path, FileName),
|
||||
// MaxBackups: config.MaxBackups, // files
|
||||
// MaxSize: config.MaxSize, // megabytes
|
||||
// MaxAge: config.MaxAge, // days
|
||||
// }
|
||||
// }
|
Loading…
Add table
Add a link
Reference in a new issue