Module: Logif

Defined in:
lib/log_in_file/logif_module.rb

Constant Summary collapse

NOTICE =
2
INFO =
4
WARN =
8
ERROR =
16
ALL =
ERROR|WARN|INFO|NOTICE

Class Method Summary collapse

Class Method Details

.openObject Also known as: start



22
23
24
# File 'lib/log_in_file/logif_module.rb', line 22

def open
  LogInFile.open_log
end

.remove_logObject



17
18
19
# File 'lib/log_in_file/logif_module.rb', line 17

def remove_log
  LogInFile.remove_log
end

.severity?(value) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/log_in_file/logif_module.rb', line 27

def severity?(value)
  (severity_level & value) > 0
end

.severity_levelObject



31
32
33
# File 'lib/log_in_file/logif_module.rb', line 31

def severity_level
  @severity_level ||= Logif::ALL
end

.severity_level=(value) ⇒ Object



11
12
13
14
# File 'lib/log_in_file/logif_module.rb', line 11

def severity_level=(value)
  value.is_a?(Integer) || raise(ArgumentError.new("Logif.severity_level should be a Integer, not a #{value.class}."))
  @severity_level = value
end