Class: Vx::Lib::Logger::BaseLogger
- Inherits:
-
Object
- Object
- Vx::Lib::Logger::BaseLogger
show all
- Defined in:
- lib/vx/lib/logger/base_logger.rb
Instance Method Summary
collapse
Instance Method Details
5
6
7
|
# File 'lib/vx/lib/logger/base_logger.rb', line 5
def formatter
@formatter ||= ->(_,_,_,m) { m }
end
|
9
|
# File 'lib/vx/lib/logger/base_logger.rb', line 9
def formatter=(val) ; end
|
#handle(message, options = {}) ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/vx/lib/logger/base_logger.rb', line 37
def handle(message, options = {})
be = Time.now.to_f
re = nil
ex = nil
begin
re = yield options
rescue Exception => e
ex = e
end
en = Time.now.to_f
options.merge!(duration: (en - be))
if ex
error message, options.merge!(exception: ex) if ex
raise ex
else
info message, options
end
re
end
|
#level ⇒ Object
19
20
21
|
# File 'lib/vx/lib/logger/base_logger.rb', line 19
def level
@logger.level
end
|
#level=(new_val) ⇒ Object
23
24
25
|
# File 'lib/vx/lib/logger/base_logger.rb', line 23
def level=(new_val)
@logger.level = new_val
end
|
#progname ⇒ Object
11
12
13
|
# File 'lib/vx/lib/logger/base_logger.rb', line 11
def progname
Lib::Logger.progname
end
|
#progname=(val) ⇒ Object
15
16
17
|
# File 'lib/vx/lib/logger/base_logger.rb', line 15
def progname=(val)
end
|