You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. "+
408
+
"If the value is 0, the maximum file size is unlimited.")
409
+
commandLine.BoolVar(&logging.toStderr, "logtostderr", true, "log to standard error instead of files")
410
+
commandLine.BoolVar(&logging.alsoToStderr, "alsologtostderr", false, "log to standard error as well as files (no effect when -logtostderr=true)")
411
+
logging.setVState(0, nil, false)
412
+
commandLine.Var(&logging.verbosity, "v", "number for the log level verbosity")
413
+
commandLine.BoolVar(&logging.addDirHeader, "add_dir_header", false, "If true, adds the file directory to the header of the log messages")
414
+
commandLine.BoolVar(&logging.skipHeaders, "skip_headers", false, "If true, avoid header prefixes in the log messages")
415
+
commandLine.BoolVar(&logging.oneOutput, "one_output", false, "If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)")
416
+
commandLine.BoolVar(&logging.skipLogHeaders, "skip_log_headers", false, "If true, avoid headers when opening log files (no effect when -logtostderr=true)")
401
417
logging.stderrThreshold=severityValue{
402
418
Severity: severity.ErrorLog, // Default stderrThreshold is ERROR.
403
419
}
404
-
logging.setVState(0, nil, false)
405
-
logging.logDir=""
406
-
logging.logFile=""
407
-
logging.logFileMaxSizeMB=1800
408
-
logging.toStderr=true
409
-
logging.alsoToStderr=false
410
-
logging.skipHeaders=false
411
-
logging.addDirHeader=false
412
-
logging.skipLogHeaders=false
413
-
logging.oneOutput=false
420
+
commandLine.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=false)")
421
+
commandLine.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging")
422
+
commandLine.Var(&logging.traceLocation, "log_backtrace_at", "when logging hits line file:N, emit a stack trace")
"Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. "+
427
-
"If the value is 0, the maximum file size is unlimited.")
428
-
flagset.BoolVar(&logging.toStderr, "logtostderr", logging.toStderr, "log to standard error instead of files")
429
-
flagset.BoolVar(&logging.alsoToStderr, "alsologtostderr", logging.alsoToStderr, "log to standard error as well as files (no effect when -logtostderr=true)")
430
-
flagset.Var(&logging.verbosity, "v", "number for the log level verbosity")
431
-
flagset.BoolVar(&logging.addDirHeader, "add_dir_header", logging.addDirHeader, "If true, adds the file directory to the header of the log messages")
432
-
flagset.BoolVar(&logging.skipHeaders, "skip_headers", logging.skipHeaders, "If true, avoid header prefixes in the log messages")
433
-
flagset.BoolVar(&logging.oneOutput, "one_output", logging.oneOutput, "If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)")
434
-
flagset.BoolVar(&logging.skipLogHeaders, "skip_log_headers", logging.skipLogHeaders, "If true, avoid headers when opening log files (no effect when -logtostderr=true)")
435
-
flagset.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=false)")
436
-
flagset.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging")
437
-
flagset.Var(&logging.traceLocation, "log_backtrace_at", "when logging hits line file:N, emit a stack trace")
438
+
commandLine.VisitAll(func(f*flag.Flag) {
439
+
flagset.Var(f.Value, f.Name, f.Usage)
440
+
})
438
441
}
439
442
440
443
// Flush flushes all pending log I/O.
@@ -549,12 +552,6 @@ type loggingT struct {
549
552
vmapmap[uintptr]Level
550
553
}
551
554
552
-
varlogging=loggingT{
553
-
settings: settings{
554
-
contextualLoggingEnabled: true,
555
-
},
556
-
}
557
-
558
555
// setVState sets a consistent state for V logging.
If true, adds the file directory to the header of the log messages
791
+
-alsologtostderr
792
+
log to standard error as well as files (no effect when -logtostderr=true)
793
+
-log_backtrace_at value
794
+
when logging hits line file:N, emit a stack trace
795
+
-log_dir string
796
+
If non-empty, write log files in this directory (no effect when -logtostderr=true)
797
+
-log_file string
798
+
If non-empty, use this log file (no effect when -logtostderr=true)
799
+
-log_file_max_size uint
800
+
Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
801
+
-logtostderr
802
+
log to standard error instead of files (default true)
803
+
-one_output
804
+
If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)
805
+
-skip_headers
806
+
If true, avoid header prefixes in the log messages
807
+
-skip_log_headers
808
+
If true, avoid headers when opening log files (no effect when -logtostderr=true)
809
+
-stderrthreshold value
810
+
logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=false) (default 2)
811
+
-v value
812
+
number for the log level verbosity
813
+
-vmodule value
814
+
comma-separated list of pattern=N settings for file-filtered logging
815
+
`
816
+
817
+
varoutput bytes.Buffer
818
+
fs.SetOutput(&output)
819
+
fs.PrintDefaults()
820
+
actualFlags:=output.String()
821
+
822
+
ifexpectedFlags!=actualFlags {
823
+
t.Fatalf("Command line changed.\nExpected:\n%q\nActual:\n%q\n", expectedFlags, actualFlags)
0 commit comments