Class: Cfruby::CfrubyLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/libcfenjin/cflogger.rb

Constant Summary collapse

@@logger =
nil

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dry_runObject (readonly)

only logging



13
14
15
# File 'lib/libcfenjin/cflogger.rb', line 13

def dry_run
  @dry_run
end

#quiet_modeObject (readonly)

no logging



14
15
16
# File 'lib/libcfenjin/cflogger.rb', line 14

def quiet_mode
  @quiet_mode
end

Class Method Details

.instanceObject

Returns the current logger instance (either self which serves only as a dummy placeholder, or a user-set logger)



23
24
25
26
27
28
29
# File 'lib/libcfenjin/cflogger.rb', line 23

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



34
35
36
# File 'lib/libcfenjin/cflogger.rb', line 34

def CfrubyLogger.set_logger(logger)
	@@logger = logger
end

Instance Method Details

#acting(msg = nil) ⇒ Object



51
52
53
# File 'lib/libcfenjin/cflogger.rb', line 51

def acting(msg=nil)
	yield if !dry_run
end

#change(level, msg, progname = nil) ⇒ Object



62
63
# File 'lib/libcfenjin/cflogger.rb', line 62

def change(level,msg,progname=nil)
end

#debug(level, msg, progname = nil) ⇒ Object



66
67
# File 'lib/libcfenjin/cflogger.rb', line 66

def debug(level,msg,progname=nil)
end

#error(level, msg, progname = nil) ⇒ Object



74
75
# File 'lib/libcfenjin/cflogger.rb', line 74

def error(level,msg,progname=nil)
end

#fatal(level, msg, progname = nil) ⇒ Object



78
79
# File 'lib/libcfenjin/cflogger.rb', line 78

def fatal(level,msg,progname=nil)
end

#help(msg, action = 'unknown') ⇒ Object

stub functions for improved logging - for a full implementation see Cfp_logger.



41
42
43
# File 'lib/libcfenjin/cflogger.rb', line 41

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



58
59
# File 'lib/libcfenjin/cflogger.rb', line 58

def info(level,msg,progname=nil)
end

#status(msg = nil) ⇒ Object



45
46
# File 'lib/libcfenjin/cflogger.rb', line 45

def status(msg=nil)
end

#testing(msg = nil) ⇒ Object



48
49
# File 'lib/libcfenjin/cflogger.rb', line 48

def testing(msg=nil)
end

#warn(level, msg, progname = nil) ⇒ Object



70
71
# File 'lib/libcfenjin/cflogger.rb', line 70

def warn(level,msg,progname=nil)
end