[Error] In lib/json_logger.cr:9:61 9 | def initialize(logdev = STDOUT, formatter = my_formatter, @env = nil) Error: instance variable @env of JSONLogger was inferred to be Nil, but Nil alone provides no information
This error is reported when "JSONLogger.new" is used. Fix it.
Signed-off-by: Wu Zhende wuzhende666@163.com --- src/lib/json_logger.cr | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/lib/json_logger.cr b/src/lib/json_logger.cr index 9596243..dd87020 100644 --- a/src/lib/json_logger.cr +++ b/src/lib/json_logger.cr @@ -4,6 +4,9 @@ require "logger" require "json" require "any_merge" +require "kemal" + +add_context_storage_type(Time::Span)
class JSONLogger < Logger def initialize(logdev = STDOUT, formatter = my_formatter, @env = nil)