Class: TorqueBox::FallbackLogger Private
- Inherits:
-
Logger
- Object
- Logger
- TorqueBox::FallbackLogger
- Defined in:
- lib/torquebox/logger.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #formatter ⇒ Object private
Instance Method Summary collapse
- #add(severity, message, progname, &block) ⇒ Object private
- #flush ⇒ Object private
-
#initialize(name = nil) ⇒ FallbackLogger
constructor
private
A new instance of FallbackLogger.
-
#puts(message) ⇒ Object
private
Allow our logger to be used for env.
- #write(message) ⇒ Object private
Constructor Details
#initialize(name = nil) ⇒ FallbackLogger
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FallbackLogger.
27 28 29 30 31 |
# File 'lib/torquebox/logger.rb', line 27 def initialize name = nil super(ENV['TORQUEBOX_FALLBACK_LOGFILE'] || $stderr) @category = name || (TORQUEBOX_APP_NAME if defined? TORQUEBOX_APP_NAME) || "TorqueBox" @formatter = ::Logger::Formatter.new end |
Instance Attribute Details
#formatter ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/torquebox/logger.rb', line 25 def formatter @formatter end |
Instance Method Details
#add(severity, message, progname, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 37 38 39 40 |
# File 'lib/torquebox/logger.rb', line 33 def add(severity, , progname, &block) if ( .nil? && block.nil? ) = progname progname = @category end = progname if .nil? super( severity, , @category, &block ) end |
#flush ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
49 50 |
# File 'lib/torquebox/logger.rb', line 49 def flush end |
#puts(message) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Allow our logger to be used for env
43 44 45 |
# File 'lib/torquebox/logger.rb', line 43 def puts() info .to_s end |
#write(message) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
46 47 48 |
# File 'lib/torquebox/logger.rb', line 46 def write() info .strip end |