lib/bixby-common/util/log.rb in bixby-common-0.4.0 vs lib/bixby-common/util/log.rb in bixby-common-0.4.1
- old
+ new
@@ -1,9 +1,10 @@
require "logging"
require "bixby-common/util/log/filtering_layout"
+require "bixby-common/util/log/logger"
module Bixby
# A simple logging mixin
module Log
@@ -38,11 +39,11 @@
# set level: ENV flag overrides; default to warn
opts[:level] = :debug if ENV["BIXBY_DEBUG"]
opts[:level] ||= :warn
- pattern = opts.delete(:pattern) || '%.1l, [%d] %5l -- %c: %m\n'
+ pattern = opts.delete(:pattern) || '%.1l, [%d] %5l -- %c:%L: %m\n'
layout = Logging.layouts.pattern(:pattern => pattern)
opts[:filename] ||= Bixby.path("var", "bixby-agent.log")
FileUtils.mkdir_p(File.dirname(opts[:filename]))
@@ -77,9 +78,10 @@
}.merge(opts)
Logging.appenders.rolling_file("file", options)
Logging::Logger.root.add_appenders("file")
Logging::Logger.root.level = opts[:level]
+ Logging::Logger.root.trace = true
end
end # Log
end