Class: Cfruby::CfrubyLogger
- Inherits:
-
Object
- Object
- Cfruby::CfrubyLogger
- Defined in:
- lib/libcfenjin/cflogger.rb
Constant Summary collapse
- @@logger =
nil
Instance Attribute Summary collapse
-
#dry_run ⇒ Object
readonly
only logging.
-
#quiet_mode ⇒ Object
readonly
no logging.
Class Method Summary collapse
-
.instance ⇒ Object
Returns the current logger instance (either self which serves only as a dummy placeholder, or a user-set logger).
-
.set_logger(logger) ⇒ Object
Sets the singleton logger object to the passed in logger.
Instance Method Summary collapse
- #acting(msg = nil) ⇒ Object
- #change(level, msg, progname = nil) ⇒ Object
- #debug(level, msg, progname = nil) ⇒ Object
- #error(level, msg, progname = nil) ⇒ Object
- #fatal(level, msg, progname = nil) ⇒ Object
-
#help(msg, action = 'unknown') ⇒ Object
stub functions for improved logging - for a full implementation see
Cfp_logger
. -
#info(level, msg, progname = nil) ⇒ Object
stub functions to implement a logger that doesn’t log - see
FileCopy.fcopy
for a code example. - #status(msg = nil) ⇒ Object
- #testing(msg = nil) ⇒ Object
- #warn(level, msg, progname = nil) ⇒ Object
Instance Attribute Details
#dry_run ⇒ Object (readonly)
only logging
12 13 14 |
# File 'lib/libcfenjin/cflogger.rb', line 12 def dry_run @dry_run end |
#quiet_mode ⇒ Object (readonly)
no logging
13 14 15 |
# File 'lib/libcfenjin/cflogger.rb', line 13 def quiet_mode @quiet_mode end |
Class Method Details
.instance ⇒ Object
Returns the current logger instance (either self which serves only as a dummy placeholder, or a user-set logger)
22 23 24 25 26 27 28 |
# File 'lib/libcfenjin/cflogger.rb', line 22 def CfrubyLogger.instance() if(@@logger == nil) @@logger = new() else return(@@logger) end end |
.set_logger(logger) ⇒ Object
Sets the singleton logger object to the passed in logger. Logger is expected to conform to the standard logger interface
33 34 35 |
# File 'lib/libcfenjin/cflogger.rb', line 33 def CfrubyLogger.set_logger(logger) @@logger = logger end |
Instance Method Details
#acting(msg = nil) ⇒ Object
50 51 52 |
# File 'lib/libcfenjin/cflogger.rb', line 50 def acting(msg=nil) yield if !dry_run end |
#change(level, msg, progname = nil) ⇒ Object
61 62 |
# File 'lib/libcfenjin/cflogger.rb', line 61 def change(level,msg,progname=nil) end |
#debug(level, msg, progname = nil) ⇒ Object
65 66 |
# File 'lib/libcfenjin/cflogger.rb', line 65 def debug(level,msg,progname=nil) end |
#error(level, msg, progname = nil) ⇒ Object
73 74 |
# File 'lib/libcfenjin/cflogger.rb', line 73 def error(level,msg,progname=nil) end |
#fatal(level, msg, progname = nil) ⇒ Object
77 78 |
# File 'lib/libcfenjin/cflogger.rb', line 77 def fatal(level,msg,progname=nil) end |
#help(msg, action = 'unknown') ⇒ Object
stub functions for improved logging - for a full implementation see Cfp_logger
.
40 41 42 |
# File 'lib/libcfenjin/cflogger.rb', line 40 def help(msg,action='unknown') self end |
#info(level, msg, progname = nil) ⇒ Object
stub functions to implement a logger that doesn’t log - see FileCopy.fcopy
for a code example
57 58 |
# File 'lib/libcfenjin/cflogger.rb', line 57 def info(level,msg,progname=nil) end |
#status(msg = nil) ⇒ Object
44 45 |
# File 'lib/libcfenjin/cflogger.rb', line 44 def status(msg=nil) end |
#testing(msg = nil) ⇒ Object
47 48 |
# File 'lib/libcfenjin/cflogger.rb', line 47 def testing(msg=nil) end |
#warn(level, msg, progname = nil) ⇒ Object
69 70 |
# File 'lib/libcfenjin/cflogger.rb', line 69 def warn(level,msg,progname=nil) end |