Class: Rubinius::RailsLogger
- Inherits:
-
Object
- Object
- Rubinius::RailsLogger
- Defined in:
- lib/rubinius/rails_logger.rb,
lib/rubinius/rails_logger/version.rb
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Attribute Summary collapse
-
#formatter ⇒ Object
These operations are no-ops but provided for method-call compatibility.
-
#level ⇒ Object
These operations are no-ops but provided for method-call compatibility.
-
#progname ⇒ Object
These operations are no-ops but provided for method-call compatibility.
Instance Method Summary collapse
- #debug(message, &block) ⇒ Object
- #debug? ⇒ Boolean
- #error(message, &block) ⇒ Object
- #error? ⇒ Boolean
- #fatal(message, &block) ⇒ Object
- #fatal? ⇒ Boolean
- #info(message, &block) ⇒ Object
- #info? ⇒ Boolean
-
#initialize(name) ⇒ RailsLogger
constructor
A new instance of RailsLogger.
- #log(severity, message, &block) ⇒ Object
- #warn(message, &block) ⇒ Object
- #warn? ⇒ Boolean
- #write(message, &block) ⇒ Object (also: #unknown)
Constructor Details
#initialize(name) ⇒ RailsLogger
Returns a new instance of RailsLogger.
8 9 10 11 |
# File 'lib/rubinius/rails_logger.rb', line 8 def initialize(name) @logger = Rubinius::Logger.new name @level = :warn end |
Instance Attribute Details
#formatter ⇒ Object
These operations are no-ops but provided for method-call compatibility.
6 7 8 |
# File 'lib/rubinius/rails_logger.rb', line 6 def formatter @formatter end |
#level ⇒ Object
These operations are no-ops but provided for method-call compatibility.
6 7 8 |
# File 'lib/rubinius/rails_logger.rb', line 6 def level @level end |
#progname ⇒ Object
These operations are no-ops but provided for method-call compatibility.
6 7 8 |
# File 'lib/rubinius/rails_logger.rb', line 6 def progname @progname end |
Instance Method Details
#debug(message, &block) ⇒ Object
61 62 63 |
# File 'lib/rubinius/rails_logger.rb', line 61 def debug(, &block) log(:debug, , &block) end |
#debug? ⇒ Boolean
29 30 31 |
# File 'lib/rubinius/rails_logger.rb', line 29 def debug? false end |
#error(message, &block) ⇒ Object
49 50 51 |
# File 'lib/rubinius/rails_logger.rb', line 49 def error(, &block) log(:error, , &block) end |
#error? ⇒ Boolean
17 18 19 |
# File 'lib/rubinius/rails_logger.rb', line 17 def error? false end |
#fatal(message, &block) ⇒ Object
45 46 47 |
# File 'lib/rubinius/rails_logger.rb', line 45 def fatal(, &block) log(:fatal, , &block) end |
#fatal? ⇒ Boolean
13 14 15 |
# File 'lib/rubinius/rails_logger.rb', line 13 def fatal? false end |
#info(message, &block) ⇒ Object
57 58 59 |
# File 'lib/rubinius/rails_logger.rb', line 57 def info(, &block) log(:info, , &block) end |
#info? ⇒ Boolean
25 26 27 |
# File 'lib/rubinius/rails_logger.rb', line 25 def info? false end |
#log(severity, message, &block) ⇒ Object
33 34 35 36 |
# File 'lib/rubinius/rails_logger.rb', line 33 def log(severity, , &block) = yield if block_given? @logger.send severity, end |
#warn(message, &block) ⇒ Object
53 54 55 |
# File 'lib/rubinius/rails_logger.rb', line 53 def warn(, &block) log(:warn, , &block) end |
#warn? ⇒ Boolean
21 22 23 |
# File 'lib/rubinius/rails_logger.rb', line 21 def warn? true end |
#write(message, &block) ⇒ Object Also known as: unknown
38 39 40 41 |
# File 'lib/rubinius/rails_logger.rb', line 38 def write(, &block) = yield if block_given? @logger.write end |