Skip to content

fix(config): change default show mode for time and level fields to 'always'#1264

Merged
pamburus merged 1 commit intomasterfrom
feature/fields-show-always
Jan 11, 2026
Merged

fix(config): change default show mode for time and level fields to 'always'#1264
pamburus merged 1 commit intomasterfrom
feature/fields-show-always

Conversation

@pamburus
Copy link
Copy Markdown
Owner

Change show mode for time and level fields to always

Summary

Changes the default show setting from auto to always for the predefined time and level fields in the default configuration.

Motivation

The auto mode conditionally shows/hides fields based on whether certain field variants are present in the logs. While this can make output more compact, it leads to inconsistent formatting:

  • Headers and field positions shift depending on log content
  • Output format becomes unpredictable
  • Confusing user experience when fields appear/disappear

The always mode provides consistent, predictable output format regardless of log content.

Changes

Configuration Changes

File: etc/defaults/config.toml

Changed for both time and level predefined fields:

-show = "auto"
+show = "always"

Also added inline documentation explaining the available options:

# Determines when to show the time field automatically based on the presence of time variants.
# Options: ["always", "auto"].
show = "always"

Behavior Impact

Before (auto mode):

  • Time field only shown when timestamp variants detected
  • Level field only shown when level variants detected
  • Output format varies based on log content

After (always mode):

  • Time field always shown (with placeholders if no timestamp)
  • Level field always shown (with placeholders if no level)
  • Consistent output format across all logs

Examples

Before (show = "auto")

message without timestamp
2026-01-01 10:30:45.123 message with timestamp
[INF] message with level
2026-01-01 10:30:45.123 [INF] message with both

After (show = "always")

####-##-## ##:##:##.### [###] message without timestamp
2026-01-01 10:30:45.123 [###] message with timestamp
####-##-## ##:##:##.### [INF] message with level
2026-01-01 10:30:45.123 [INF] message with both

Migration

Users who prefer the old behavior can override in user config (~/.config/hl/config.toml):

[fields.predefined.time]
show = "auto"

[fields.predefined.level]
show = "auto"

Breaking Change

⚠️ This is a minor breaking change in default behavior. The output format will be more consistent but may look different for users relying on auto-hiding of these fields.

…lways'

Changes the default 'show' setting from 'auto' to 'always' for both the
'time' and 'level' predefined fields to ensure consistent output format.

This prevents the fields from being hidden when certain field variants
are absent in the logs, making the output more predictable and uniform.

Also adds inline documentation comments explaining the show options.
@pamburus pamburus added the enhancement New feature or request label Jan 11, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.92%. Comparing base (314b309) to head (6f6a324).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1264   +/-   ##
=======================================
  Coverage   87.92%   87.92%           
=======================================
  Files          67       67           
  Lines       11567    11567           
=======================================
  Hits        10170    10170           
  Misses       1397     1397           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pamburus pamburus marked this pull request as ready for review January 11, 2026 20:48
@pamburus pamburus merged commit f392c44 into master Jan 11, 2026
13 checks passed
@pamburus pamburus deleted the feature/fields-show-always branch January 11, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant