Class: Klogger::TaggedLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/klogger/tagged_logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent, **tags) ⇒ TaggedLogger

Returns a new instance of TaggedLogger.



8
9
10
11
# File 'lib/klogger/tagged_logger.rb', line 8

def initialize(parent, **tags)
  @parent = parent
  @tags = tags
end

Instance Method Details

#add_group(**tags) ⇒ Object



27
28
29
# File 'lib/klogger/tagged_logger.rb', line 27

def add_group(**tags)
  @parent.add_group(**@tags.merge(tags))
end

#create_tagged_logger(**tags) ⇒ Object



51
52
53
# File 'lib/klogger/tagged_logger.rb', line 51

def create_tagged_logger(**tags)
  @parent.create_tagged_logger(**@tags.merge(tags))
end

#exception(exception, message = nil, **tags) ⇒ Object



19
20
21
# File 'lib/klogger/tagged_logger.rb', line 19

def exception(exception, message = nil, **tags)
  @parent.exception(exception, message, **@tags.merge(tags))
end

#group(**tags, &block) ⇒ Object



23
24
25
# File 'lib/klogger/tagged_logger.rb', line 23

def group(**tags, &block)
  @parent.group(**@tags.merge(tags), &block)
end

#pop_groupObject



31
32
33
# File 'lib/klogger/tagged_logger.rb', line 31

def pop_group
  @parent.pop_group
end

#silence!(&block) ⇒ Object



39
40
41
# File 'lib/klogger/tagged_logger.rb', line 39

def silence!(&block)
  @parent.silence!(&block)
end

#silenced?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/klogger/tagged_logger.rb', line 47

def silenced?
  @parent.silenced?
end

#tagged(**tags, &block) ⇒ Object



35
36
37
# File 'lib/klogger/tagged_logger.rb', line 35

def tagged(**tags, &block)
  @parent.tagged(**@tags.merge(tags), &block)
end

#unsilence!(&block) ⇒ Object



43
44
45
# File 'lib/klogger/tagged_logger.rb', line 43

def unsilence!(&block)
  @parent.unsilence!(&block)
end