Module: INat::App::Logger::DSL
- Includes:
- Config
- Included in:
- INat::API, Task::DSL, DB, Data::Entity, Data::Entity, Data::Model, Query
- Defined in:
- lib/inat/app/globals.rb
Class Method Summary collapse
- .debug(message) ⇒ Object
- .echo(message, level: MessageLevel::UNKNOWN) ⇒ Object
- .error(message, exception: nil) ⇒ Object
- .info(message) ⇒ Object
- .log(message, level: MessageLevel::INFO) ⇒ Object
- .warning(message) ⇒ Object
Instance Method Summary collapse
- #debug(message) ⇒ Object private
- #echo(message, level: MessageLevel::UNKNOWN) ⇒ Object private
- #error(message, exception: nil) ⇒ Object private
- #info(message) ⇒ Object private
- #log(message, level: MessageLevel::INFO) ⇒ Object private
- #warning(message) ⇒ Object private
Class Method Details
.debug(message) ⇒ Object
73 74 75 |
# File 'lib/inat/app/globals.rb', line 73 def debug log , level: MessageLevel::DEBUG end |
.echo(message, level: MessageLevel::UNKNOWN) ⇒ Object
77 78 79 |
# File 'lib/inat/app/globals.rb', line 77 def echo , level: MessageLevel::UNKNOWN log , level: level end |
.error(message, exception: nil) ⇒ Object
60 61 62 63 |
# File 'lib/inat/app/globals.rb', line 60 def error , exception: nil log , level: MessageLevel::ERROR raise exception, if Class === exception && Exception >= exception end |
.info(message) ⇒ Object
69 70 71 |
# File 'lib/inat/app/globals.rb', line 69 def info log , level: MessageLevel::INFO end |
.log(message, level: MessageLevel::INFO) ⇒ Object
54 55 56 57 58 |
# File 'lib/inat/app/globals.rb', line 54 def log , level: MessageLevel::INFO G.status.wrap do G.logger.log(G.current_task&.name || '‹main›', level, ) end end |
.warning(message) ⇒ Object
65 66 67 |
# File 'lib/inat/app/globals.rb', line 65 def warning log , level: MessageLevel::WARNING end |
Instance Method Details
#debug(message) ⇒ Object (private)
73 74 75 |
# File 'lib/inat/app/globals.rb', line 73 def debug log , level: MessageLevel::DEBUG end |
#echo(message, level: MessageLevel::UNKNOWN) ⇒ Object (private)
77 78 79 |
# File 'lib/inat/app/globals.rb', line 77 def echo , level: MessageLevel::UNKNOWN log , level: level end |
#error(message, exception: nil) ⇒ Object (private)
60 61 62 63 |
# File 'lib/inat/app/globals.rb', line 60 def error , exception: nil log , level: MessageLevel::ERROR raise exception, if Class === exception && Exception >= exception end |
#info(message) ⇒ Object (private)
69 70 71 |
# File 'lib/inat/app/globals.rb', line 69 def info log , level: MessageLevel::INFO end |
#log(message, level: MessageLevel::INFO) ⇒ Object (private)
54 55 56 57 58 |
# File 'lib/inat/app/globals.rb', line 54 def log , level: MessageLevel::INFO G.status.wrap do G.logger.log(G.current_task&.name || '‹main›', level, ) end end |
#warning(message) ⇒ Object (private)
65 66 67 |
# File 'lib/inat/app/globals.rb', line 65 def warning log , level: MessageLevel::WARNING end |