Class: TrueandcoAnalytics::Logger
- Inherits:
-
Logger
- Object
- Logger
- TrueandcoAnalytics::Logger
- Includes:
- Singleton
- Defined in:
- lib/trueandco_analytics/common/services/logger.rb
Instance Method Summary collapse
- #formatter ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
6 7 8 9 10 |
# File 'lib/trueandco_analytics/common/services/logger.rb', line 6 def initialize super(Rails.root.join("log/#{Config::Params.log}.log")) self.formatter = formatter self end |
Instance Method Details
#formatter ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/trueandco_analytics/common/services/logger.rb', line 12 def formatter Proc.new { |severity, time, progname, msg| formatted_severity = sprintf("%-5s", severity.to_s) formatted_time = time.strftime("%Y-%m-%d %H:%M:%S") "[#{formatted_severity} #{formatted_time} #{$$}] #{msg.to_s.strip}\n" } end |