Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Commit a537d1b

Browse files
feat: Reduce logger output during development (#576)
1 parent ecab858 commit a537d1b

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## UNRELEASED - Runtime
4+
5+
- feat: Reduce logger output during development [#576](https://github.com/hypermodeinc/modus/pull/576)
6+
37
## 2024-11-08 - CLI 0.13.8
48

59
- fix: Make `modus --version` just print modus CLI's version [#563](https://github.com/hypermodeinc/modus/pull/563)

runtime/logger/logger.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,28 @@ func Initialize() *zerolog.Logger {
4141
// In console mode, we can use local time and be a bit prettier.
4242
// We'll still log with millisecond precision.
4343
zerolog.TimeFieldFormat = zerolog.TimeFormatUnixMs
44-
writer = zerolog.ConsoleWriter{
45-
Out: os.Stderr,
46-
TimeFormat: "2006-01-02 15:04:05.000 -07:00",
44+
consoleWriter := zerolog.ConsoleWriter{Out: os.Stderr}
45+
if config.IsDevEnvironment() {
46+
consoleWriter.TimeFormat = "15:04:05.000"
47+
consoleWriter.FieldsExclude = []string{
48+
"build_id",
49+
"build_ts",
50+
"git_commit",
51+
"git_repo",
52+
"plugin",
53+
"user_visible",
54+
}
55+
consoleWriter.FieldsOrder = []string{
56+
"detail",
57+
"function",
58+
"execution_id",
59+
"duration_ms",
60+
}
61+
} else {
62+
consoleWriter.TimeFormat = "2006-01-02 15:04:05.000 -07:00"
4763
}
64+
65+
writer = consoleWriter
4866
}
4967

5068
// Log the runtime version to every log line, except in development.

0 commit comments

Comments
 (0)