feat(retention): added image retention policies (#1866)

feat(metaDB): add more image statistics info

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
peusebiu
2023-11-01 18:16:18 +02:00
committed by GitHub
parent a79d79a03a
commit 9074f8483b
71 changed files with 3454 additions and 745 deletions
+10 -6
View File
@@ -52,7 +52,7 @@ func NewLogger(level, output string) Logger {
return Logger{Logger: log.Hook(goroutineHook{}).With().Caller().Timestamp().Logger()}
}
func NewAuditLogger(level, audit string) *Logger {
func NewAuditLogger(level, output string) *Logger {
loggerSetTimeFormat.Do(func() {
zerolog.TimeFieldFormat = time.RFC3339Nano
})
@@ -66,12 +66,16 @@ func NewAuditLogger(level, audit string) *Logger {
var auditLog zerolog.Logger
auditFile, err := os.OpenFile(audit, os.O_APPEND|os.O_WRONLY|os.O_CREATE, defaultPerms)
if err != nil {
panic(err)
}
if output == "" {
auditLog = zerolog.New(os.Stdout)
} else {
auditFile, err := os.OpenFile(output, os.O_APPEND|os.O_WRONLY|os.O_CREATE, defaultPerms)
if err != nil {
panic(err)
}
auditLog = zerolog.New(auditFile)
auditLog = zerolog.New(auditFile)
}
return &Logger{Logger: auditLog.With().Timestamp().Logger()}
}