Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to change format from [loglvl] [timestamp] to [timestamp] [loglvl] #101

Open
shayanhabibi opened this issue Aug 4, 2021 · 0 comments

Comments

@shayanhabibi
Copy link

options.nim

  chronicles_lvl_first {.strdefine.} = "on"

  ##

  const logLevelFirst* = handleYesNoOption chronicles_lvl_first

log_output.nim

  when logLevelFirst: appendLogLevelMarker(r, lvl, true)

  when r.timestamps != NoTimestamps:
    when logLevelFirst: append(r.output, " ")
    writeTs(r)

  when not logLevelFirst:
    when r.timestamps != NoTimeStamps: append(r.output, " ")
    appendLogLevelMarker(r, lvl, true)

Human consumption of the output might make sense to have the log lvl prior to the message since time stamps are less relevant on human message consumption than the log lvl and message yet adds a large space between the two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant