Module: VivlioStarter::Pdf::LogHelper
- Defined in:
- lib/vivlio_starter/cli/pdf/log_helper.rb
Overview
Logging helper that integrates with vivlio-starter CLI when available
Class Method Summary collapse
- .dispatch(method, message) ⇒ Object
- .log_action(message) ⇒ Object
- .log_error(message) ⇒ Object
- .log_info(message) ⇒ Object
- .log_success(message) ⇒ Object
- .log_warn(message) ⇒ Object
Class Method Details
.dispatch(method, message) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/vivlio_starter/cli/pdf/log_helper.rb', line 29 def dispatch(method, ) if defined?(VivlioStarter::CLI::Common) VivlioStarter::CLI::Common.public_send(method, ) else yield if block_given? end end |
.log_action(message) ⇒ Object
9 10 11 |
# File 'lib/vivlio_starter/cli/pdf/log_helper.rb', line 9 def log_action() dispatch(:log_action, ) { puts() } end |
.log_error(message) ⇒ Object
25 26 27 |
# File 'lib/vivlio_starter/cli/pdf/log_helper.rb', line 25 def log_error() dispatch(:log_error, ) { warn() } end |
.log_info(message) ⇒ Object
13 14 15 |
# File 'lib/vivlio_starter/cli/pdf/log_helper.rb', line 13 def log_info() dispatch(:log_info, ) { puts() } end |
.log_success(message) ⇒ Object
17 18 19 |
# File 'lib/vivlio_starter/cli/pdf/log_helper.rb', line 17 def log_success() dispatch(:log_success, ) { puts() } end |
.log_warn(message) ⇒ Object
21 22 23 |
# File 'lib/vivlio_starter/cli/pdf/log_helper.rb', line 21 def log_warn() dispatch(:log_warn, ) { warn() } end |