Class: MyLocalPutio::Logger
- Inherits:
-
Object
- Object
- MyLocalPutio::Logger
- Defined in:
- lib/my-local-putio/logger.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #debug(msg) ⇒ Object
- #debug? ⇒ Boolean
-
#initialize(configuration) ⇒ Logger
constructor
A new instance of Logger.
- #log(msg) ⇒ Object
- #silent? ⇒ Boolean
Constructor Details
#initialize(configuration) ⇒ Logger
Returns a new instance of Logger.
5 6 7 |
# File 'lib/my-local-putio/logger.rb', line 5 def initialize(configuration) @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
3 4 5 |
# File 'lib/my-local-putio/logger.rb', line 3 def configuration @configuration end |
Instance Method Details
#debug(msg) ⇒ Object
17 18 19 20 |
# File 'lib/my-local-putio/logger.rb', line 17 def debug(msg) return unless debug? print_msg "[DEBUG][#{time_now}] #{msg}" end |
#debug? ⇒ Boolean
13 14 15 |
# File 'lib/my-local-putio/logger.rb', line 13 def debug? configuration.debug end |
#log(msg) ⇒ Object
22 23 24 |
# File 'lib/my-local-putio/logger.rb', line 22 def log(msg) print_msg "[LOG][#{time_now}] #{msg}" end |
#silent? ⇒ Boolean
9 10 11 |
# File 'lib/my-local-putio/logger.rb', line 9 def silent? configuration.silent end |