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

using a LogLevel below -1000 #91

Closed
kaat0 opened this issue Jun 1, 2024 · 1 comment
Closed

using a LogLevel below -1000 #91

kaat0 opened this issue Jun 1, 2024 · 1 comment

Comments

@kaat0
Copy link

kaat0 commented Jun 1, 2024

Hi,

thanks for the great work! I stumbled upon a problem and I am not sure if I misunderstood or if it is a bug. The use of a LogLevel below -1000 does not seem to work. And LoggingExtras.withlevel() does not seem to have an effect.
I tested it on Julia v1.10.3 with LoggingExtras v1.0.3.
Consider the following code:

using Logging, LoggingExtras

Trace = Logging.LogLevel(-2000)
LoggingExtras.withlevel(Trace) do
  @logmsg Trace "test LogLevel -2000" # not shown
  @debug        "test LogLevel -1000" # not shown
end

Both messages are not shown, but I would have expected otherwise.

Furthermore, my "fixes" did not work either:

logger = LoggingExtras.LevelOverrideLogger(Trace, global_logger())
Logging.with_logger(logger) do
  @info Logging.min_enabled_level(logger) == Trace # true
  @logmsg Trace "test LogLevel -2000" # not shown
  @debug        "test LogLevel -1000" # shown
end

At least now, the debug message is show, but I would have expected both messages to be shown.

The same is true for the following code:

logger = Logging.ConsoleLogger(stderr, Trace)
Logging.with_logger(logger) do
  @info Logging.min_enabled_level(logger) == Trace # true
  @logmsg Trace "test LogLevel -2000" # not shown
  @debug        "test LogLevel -1000" # shown
end

Or:

global_logger(logger)
@info Logging.min_enabled_level(logger) == Trace # true
@logmsg Trace "test LogLevel -2000" # not shown
@debug        "test LogLevel -1000" # shown

Did I miss something?

@kaat0
Copy link
Author

kaat0 commented Jun 2, 2024

Just found julia/issues/52234

@kaat0 kaat0 closed this as completed Jun 2, 2024
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