Class: Zakuro::Output::Logger
- Inherits:
-
Object
- Object
- Zakuro::Output::Logger
- Defined in:
- lib/zakuro/output/logger.rb
Overview
Note:
本番では使用しない
軽量なロガー
Constant Summary collapse
- LEVELS =
Returns ログレベル.
{ none: -1, debug: 0, info: 1, warn: 2, error: 3 }.freeze
- LEVEL =
Returns 現在ログレベル.
LEVELS[:none]
Instance Attribute Summary collapse
-
#location ⇒ String
readonly
呼び出し位置.
Instance Method Summary collapse
-
#debug(*messages) ⇒ Object
DEBUGレベルの標準出力を行う.
-
#error(error, *messages) ⇒ Object
ERRORレベルの標準出力を行う.
-
#info(*messages) ⇒ Object
INFOレベルの標準出力を行う.
-
#initialize(location:) ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize(location:) ⇒ Logger
Returns a new instance of Logger.
27 28 29 |
# File 'lib/zakuro/output/logger.rb', line 27 def initialize(location:) @location = location end |
Instance Attribute Details
#location ⇒ String (readonly)
Returns 呼び出し位置.
25 26 27 |
# File 'lib/zakuro/output/logger.rb', line 25 def location @location end |
Instance Method Details
#debug(*messages) ⇒ Object
DEBUGレベルの標準出力を行う
36 37 38 39 40 41 42 |
# File 'lib/zakuro/output/logger.rb', line 36 def debug(*) return if none? return if LEVELS[:debug] < LEVEL output('DEBUG', *) end |