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.6'
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.
10 11 12 |
# File 'lib/xlog.rb', line 10 def app_name @app_name end |
.app_root ⇒ Object
Returns the value of attribute app_root.
10 11 12 |
# File 'lib/xlog.rb', line 10 def app_root @app_root end |
.base_logger ⇒ Object
Returns the value of attribute base_logger.
10 11 12 |
# File 'lib/xlog.rb', line 10 def base_logger @base_logger end |
.config ⇒ Object
Returns the value of attribute config.
10 11 12 |
# File 'lib/xlog.rb', line 10 def config @config end |
.xlogger ⇒ Object
Returns the value of attribute xlogger.
10 11 12 |
# File 'lib/xlog.rb', line 10 def xlogger @xlogger end |
Class Method Details
.and_raise_error(e, message: nil, data: nil, tags: []) ⇒ Object
34 35 36 |
# File 'lib/xlog.rb', line 34 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
18 19 20 |
# File 'lib/xlog.rb', line 18 def puts "\e[33mWARING: 'clear_tags' is no longer supported as it's not thread safe\e[0m" end |
.configure {|config| ... } ⇒ Object
39 40 41 42 |
# File 'lib/xlog.rb', line 39 def self.configure self.config ||= Config.new yield(config) end |
.error(e, message: nil, data: nil, tags: []) ⇒ Object
30 31 32 |
# File 'lib/xlog.rb', line 30 def error(e, message: nil, data: nil, tags: []) config.xlogger.error(e, , data, ) end |
.info(message, data: nil, tags: []) ⇒ Object
22 23 24 |
# File 'lib/xlog.rb', line 22 def info(, data: nil, tags: []) config.xlogger.info(, data, ) end |
.tag_logger(*_tags) ⇒ Object
rubocop:disable Layout/LineLength
13 14 15 |
# File 'lib/xlog.rb', line 13 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
26 27 28 |
# File 'lib/xlog.rb', line 26 def warn(, data: nil, tags: []) config.xlogger.warn(, data, ) end |