mirror of
https://github.com/nushell/nushell
synced 2024-12-27 21:43:09 +00:00
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
1 changed files with 3 additions and 1 deletions
|
@ -32,6 +32,8 @@ export-env {
|
||||||
}
|
}
|
||||||
|
|
||||||
$env.NU_LOG_FORMAT = $"%ANSI_START%%DATE%|%LEVEL%|(ansi u)%MSG%%ANSI_STOP%"
|
$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 [] {
|
def log-types [] {
|
||||||
|
@ -139,7 +141,7 @@ def current-log-level [] {
|
||||||
}
|
}
|
||||||
|
|
||||||
def now [] {
|
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 [
|
def handle-log [
|
||||||
|
|
Loading…
Reference in a new issue