feat(log): allow disable timestamp on terminal logs

allow disable timestamp on terminal logs

Signed-off-by: kovacs <mritd@linux.com>
This commit is contained in:
kovacs 2024-01-22 16:28:03 +08:00
parent bb7b29923a
commit 4b70971495
No known key found for this signature in database
GPG Key ID: 150E1851F767CDDD

View File

@ -45,7 +45,7 @@ func New(options Options) (Factory, error) {
logFormatter := Formatter{ logFormatter := Formatter{
BaseTime: options.BaseTime, BaseTime: options.BaseTime,
DisableColors: logOptions.DisableColor || logFilePath != "", DisableColors: logOptions.DisableColor || logFilePath != "",
DisableTimestamp: !logOptions.Timestamp && logFilePath != "", DisableTimestamp: !logOptions.Timestamp,
FullTimestamp: logOptions.Timestamp, FullTimestamp: logOptions.Timestamp,
TimestampFormat: "-0700 2006-01-02 15:04:05", TimestampFormat: "-0700 2006-01-02 15:04:05",
} }