@@ -45,6 +45,7 @@ const (
4545var (
4646 ConfigPath string
4747 Jobs int
48+ Verbosity int
4849 DumpSystemd bool
4950 DumpConfig bool
5051 ShowVersion bool
5354 PrefetchForeground bool // Standalone prefetch, prefetch and exit
5455 AllowNonImage bool
5556 Config = NewWebPConfig ()
56- Version = "0.13.0 "
57+ Version = "0.13.1 "
5758 WriteLock = cache .New (5 * time .Minute , 10 * time .Minute )
5859 ConvertLock = cache .New (5 * time .Minute , 10 * time .Minute )
5960 LocalHostAlias = "local"
@@ -144,6 +145,12 @@ func init() {
144145 flag .BoolVar (& Prefetch , "prefetch" , false , "Prefetch and convert images to optimized format, with WebP Server Go launch normally" )
145146 flag .BoolVar (& PrefetchForeground , "prefetch-foreground" , false , "Prefetch and convert image to optimized format in foreground, prefetch and exit" )
146147 flag .IntVar (& Jobs , "jobs" , runtime .NumCPU (), "Prefetch thread, default is all." )
148+ // 0 = silent (no log messages)
149+ // 1 = error (error messages only)
150+ // 2 = warn (error messages and warnings only)
151+ // 3 = info (error messages, warnings and normal activity logs)
152+ // 4 = debug (all info plus additional messages for debugging)
153+ flag .IntVar (& Verbosity , "verbosity" , 3 , "Log level(0: silent, 1: error, 2: warn, 3:info, 4: debug), default to 3: info" )
147154 flag .BoolVar (& DumpConfig , "dump-config" , false , "Print sample config.json." )
148155 flag .BoolVar (& ShowVersion , "V" , false , "Show version information." )
149156}
0 commit comments