Module: Xlog
- Defined in:
- lib/xlog.rb,
lib/xlog/version.rb,
lib/xlog/xlogger.rb,
lib/xlog/middleware.rb
Defined Under Namespace
Classes: Config, Middleware, Xlogger
Constant Summary collapse
- VERSION =
'0.1.8'
Class Attribute Summary collapse
-
.app_name ⇒ Object
Returns the value of attribute app_name.
-
.app_root ⇒ Object
Returns the value of attribute app_root.
-
.base_logger ⇒ Object
Returns the value of attribute base_logger.
-
.config ⇒ Object
Returns the value of attribute config.
-
.xlogger ⇒ Object
Returns the value of attribute xlogger.
Class Method Summary collapse
- .and_raise_error(e, message: nil, data: nil, tags: []) ⇒ Object
-
.clear_tags ⇒ Object
rubocop:enable Layout/LineLength.
- .configure {|config| ... } ⇒ Object
- .error(e, message: nil, data: nil, tags: []) ⇒ Object
- .info(message, data: nil, tags: []) ⇒ Object
-
.tag_logger(*_tags) ⇒ Object
rubocop:disable Layout/LineLength.
- .warn(message, data: nil, tags: []) ⇒ Object
Class Attribute Details
.app_name ⇒ Object
Returns the value of attribute app_name.
12 13 14 |
# File 'lib/xlog.rb', line 12 def app_name @app_name end |
.app_root ⇒ Object
Returns the value of attribute app_root.
12 13 14 |
# File 'lib/xlog.rb', line 12 def app_root @app_root end |
.base_logger ⇒ Object
Returns the value of attribute base_logger.
12 13 14 |
# File 'lib/xlog.rb', line 12 def base_logger @base_logger end |
.config ⇒ Object
Returns the value of attribute config.
12 13 14 |
# File 'lib/xlog.rb', line 12 def config @config end |
.xlogger ⇒ Object
Returns the value of attribute xlogger.
12 13 14 |
# File 'lib/xlog.rb', line 12 def xlogger @xlogger end |
Class Method Details
.and_raise_error(e, message: nil, data: nil, tags: []) ⇒ Object
36 37 38 |
# File 'lib/xlog.rb', line 36 def and_raise_error(e, message: nil, data: nil, tags: []) config.xlogger.and_raise_error(e, , data, ) end |
.clear_tags ⇒ Object
rubocop:enable Layout/LineLength
20 21 22 |
# File 'lib/xlog.rb', line 20 def puts "\e[33mWARING: 'clear_tags' is no longer supported as it's not thread safe\e[0m" end |
.configure {|config| ... } ⇒ Object
41 42 43 44 |
# File 'lib/xlog.rb', line 41 def self.configure self.config ||= Config.new yield(config) end |
.error(e, message: nil, data: nil, tags: []) ⇒ Object
32 33 34 |
# File 'lib/xlog.rb', line 32 def error(e, message: nil, data: nil, tags: []) config.xlogger.error(e, , data, ) end |
.info(message, data: nil, tags: []) ⇒ Object
24 25 26 |
# File 'lib/xlog.rb', line 24 def info(, data: nil, tags: []) config.xlogger.info(, data, ) end |
.tag_logger(*_tags) ⇒ Object
rubocop:disable Layout/LineLength
15 16 17 |
# File 'lib/xlog.rb', line 15 def tag_logger(*) puts "\e[33mWARING: 'tag_logger' is no longer supported as it's not thread safe. Use 'tags: ' named argument instead for 'info', 'warn', 'error', 'and_raise_error'.\e[0m" end |
.warn(message, data: nil, tags: []) ⇒ Object
28 29 30 |
# File 'lib/xlog.rb', line 28 def warn(, data: nil, tags: []) config.xlogger.warn(, data, ) end |