Class: Kitchen::Logger::StdoutLogger
- Inherits:
-
LogdevLogger
- Object
- Logger
- LogdevLogger
- Kitchen::Logger::StdoutLogger
- Defined in:
- lib/kitchen/logger.rb
Overview
Internal class which reformats logging methods for display as console output.
Instance Method Summary collapse
-
#debug(msg = nil, &block) ⇒ Object
Log a debug message.
-
#error(msg = nil, &block) ⇒ Object
Log an error message.
-
#fatal(msg = nil, &block) ⇒ Object
Log a fatal message.
-
#info(msg = nil, &block) ⇒ Object
Log an info message.
-
#unknown(msg = nil, &block) ⇒ Object
Log an unknown message.
-
#warn(msg = nil, &block) ⇒ Object
Log a warn message.
Methods inherited from LogdevLogger
Instance Method Details
#debug(msg = nil, &block) ⇒ Object
Log a debug message
866 867 868 869 870 871 872 |
# File 'lib/kitchen/logger.rb', line 866 def debug(msg = nil, &block) if block super(nil) { "D #{block.call}" } else super("D #{msg}") end end |
#error(msg = nil, &block) ⇒ Object
Log an error message
899 900 901 902 903 904 905 |
# File 'lib/kitchen/logger.rb', line 899 def error(msg = nil, &block) if block super(nil) { ">>>>>> #{block.call}" } else super(">>>>>> #{msg}") end end |
#fatal(msg = nil, &block) ⇒ Object
Log a fatal message
910 911 912 913 914 915 916 |
# File 'lib/kitchen/logger.rb', line 910 def fatal(msg = nil, &block) if block super(nil) { "!!!!!! #{block.call}" } else super("!!!!!! #{msg}") end end |
#info(msg = nil, &block) ⇒ Object
Log an info message
877 878 879 880 881 882 883 |
# File 'lib/kitchen/logger.rb', line 877 def info(msg = nil, &block) if block super(nil) { " #{block.call}" } else super(" #{msg}") end end |
#unknown(msg = nil, &block) ⇒ Object
Log an unknown message
921 922 923 924 925 926 927 |
# File 'lib/kitchen/logger.rb', line 921 def unknown(msg = nil, &block) if block super(nil) { "?????? #{block.call}" } else super("?????? #{msg}") end end |
#warn(msg = nil, &block) ⇒ Object
Log a warn message
888 889 890 891 892 893 894 |
# File 'lib/kitchen/logger.rb', line 888 def warn(msg = nil, &block) if block super(nil) { "$$$$$$ #{block.call}" } else super("$$$$$$ #{msg}") end end |