[#190] logging: Use time format constants from stdlib

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2025-01-10 13:52:06 +03:00
parent 3c6023ca29
commit 3ebb3dda0a
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg

View file

@ -1,6 +1,8 @@
package logging package logging
import ( import (
"time"
"github.com/dop251/goja" "github.com/dop251/goja"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"go.k6.io/k6/js/modules" "go.k6.io/k6/js/modules"
@ -60,9 +62,9 @@ func (r *RootModule) NewModuleInstance(vu modules.VU) modules.Instance {
case *logrus.TextFormatter: case *logrus.TextFormatter:
f.ForceColors = true f.ForceColors = true
f.FullTimestamp = true f.FullTimestamp = true
f.TimestampFormat = "15:04:05" f.TimestampFormat = time.TimeOnly
case *logrus.JSONFormatter: case *logrus.JSONFormatter:
f.TimestampFormat = "15:04:05" f.TimestampFormat = time.TimeOnly
} }
return &Logging{vu: vu} return &Logging{vu: vu}