forked from extern/nushell
Allow specifying a custom date format in std log (#10603)
# Description Allows the user to specify a custom date format for std log to use. # User-Facing Changes Added customization.
This commit is contained in:
parent
8c507dc984
commit
bc1b2fa5bd
@ -32,6 +32,8 @@ export-env {
|
||||
}
|
||||
|
||||
$env.NU_LOG_FORMAT = $"%ANSI_START%%DATE%|%LEVEL%|(ansi u)%MSG%%ANSI_STOP%"
|
||||
|
||||
$env.NU_LOG_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S%.3f"
|
||||
}
|
||||
|
||||
def log-types [] {
|
||||
@ -139,7 +141,7 @@ def current-log-level [] {
|
||||
}
|
||||
|
||||
def now [] {
|
||||
date now | format date "%Y-%m-%dT%H:%M:%S%.3f"
|
||||
date now | format date $env.NU_LOG_DATE_FORMAT
|
||||
}
|
||||
|
||||
def handle-log [
|
||||
|
Loading…
Reference in New Issue
Block a user