amperity / dialog

Simple just-enough logging library for Clojure
MIT License
39 stars 2 forks source link

Fix root level property setting #10

Closed greglook closed 2 years ago

greglook commented 2 years ago

There's a bug when setting the level of the root logger via an environment or property override, which causes a ClassCastException:

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Keyword
        at dialog.config$load_config.invokeStatic(config.clj:253)
        at dialog.config$load_config.invoke(config.clj:235)
        at dialog.logger$initialize_BANG_.invokeStatic(logger.clj:52)
        at dialog.logger$initialize_BANG_.invoke(logger.clj:49)
        at dialog.logger$log_event.invokeStatic(logger.clj:237)
        at dialog.logger$log_event.invoke(logger.clj:233)

This fixes the issue by coercing it to a keyword first.