Module: CustomLogger

Defined in:
lib/customlogger.rb

Constant Summary collapse

LOOP_LIMIT =
512

Class Method Summary collapse

Class Method Details

.clearObject



46
47
48
49
# File 'lib/customlogger.rb', line 46

def clear
  new_log_file
  'Wiped All Old Logs'
end

.debug(value, title = nil) ⇒ Object



76
77
78
79
# File 'lib/customlogger.rb', line 76

def debug(value, title=nil)
  log(:debug, value, title)
  value
end

.debug=(value) ⇒ Object



71
72
73
74
# File 'lib/customlogger.rb', line 71

def debug=(value)
  log(:debug, value)
  value
end

.error(value, title = nil) ⇒ Object



56
57
58
59
# File 'lib/customlogger.rb', line 56

def error(value, title=nil)
  log(:error, value, title)
  value
end

.error=(value) ⇒ Object



51
52
53
54
# File 'lib/customlogger.rb', line 51

def error=(value)
  log(:error, value)
  value
end

.error_color(state, color) ⇒ Object



32
33
34
35
# File 'lib/customlogger.rb', line 32

def error_color(state, color)
  set_error_colors if @error_colors.nil?
  @error_colors[state] = color
end

.error_colorsObject



37
38
39
# File 'lib/customlogger.rb', line 37

def error_colors
  @error_colors||=set_error_colors
end

.fileObject



20
21
22
# File 'lib/customlogger.rb', line 20

def file
  @file_name||='CustomLogger.html'
end

.file=(value) ⇒ Object



16
17
18
# File 'lib/customlogger.rb', line 16

def file=(value)
  @file_name = value
end

.info(value, title = nil) ⇒ Object



86
87
88
89
# File 'lib/customlogger.rb', line 86

def info(value, title=nil)
  log(:info, value, title)
  value
end

.info=(value) ⇒ Object



81
82
83
84
# File 'lib/customlogger.rb', line 81

def info=(value)
  log(:info, value)
  value
end

.newObject



41
42
43
44
# File 'lib/customlogger.rb', line 41

def new
  new_log_file
  'Wiped All Old Logs'
end

.pathObject



12
13
14
# File 'lib/customlogger.rb', line 12

def path
  @log_path||=[ Dir.pwd, '/log' ].join
end

.path=(value) ⇒ Object



8
9
10
# File 'lib/customlogger.rb', line 8

def path=(value)
  @log_path = value
end

.raw(value, title = nil) ⇒ Object



96
97
98
99
# File 'lib/customlogger.rb', line 96

def raw(value, title=nil)
  log(:raw, value, title)
  value
end

.raw=(value) ⇒ Object



91
92
93
94
# File 'lib/customlogger.rb', line 91

def raw=(value)
  log(:raw, value)
  value
end

.titleObject



28
29
30
# File 'lib/customlogger.rb', line 28

def title
  @title||='Custome Logger'
end

.title=(value) ⇒ Object



24
25
26
# File 'lib/customlogger.rb', line 24

def title=(value)
  @title = value
end

.warning(value, title = nil) ⇒ Object



66
67
68
69
# File 'lib/customlogger.rb', line 66

def warning(value, title=nil)
  log(:warning, value, title)
  value
end

.warning=(value) ⇒ Object



61
62
63
64
# File 'lib/customlogger.rb', line 61

def warning=(value)
  log(:warning, value)
  value
end