Class: Sbmt::Strangler::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/sbmt/strangler/logger.rb

Instance Method Summary collapse

Instance Method Details

#log_debug(message, **params) ⇒ Object



9
10
11
12
13
# File 'lib/sbmt/strangler/logger.rb', line 9

def log_debug(message, **params)
  with_tags(**params) do
    logger.debug(message)
  end
end

#log_error(message, **params) ⇒ Object



27
28
29
30
31
# File 'lib/sbmt/strangler/logger.rb', line 27

def log_error(message, **params)
  with_tags(**params) do
    logger.error(message)
  end
end

#log_failure(message, **params) ⇒ Object



37
38
39
# File 'lib/sbmt/strangler/logger.rb', line 37

def log_failure(message, **params)
  log_error(message, status: "failure", **params)
end

#log_info(message, **params) ⇒ Object



15
16
17
18
19
# File 'lib/sbmt/strangler/logger.rb', line 15

def log_info(message, **params)
  with_tags(**params) do
    logger.info(message)
  end
end

#log_success(message, **params) ⇒ Object



33
34
35
# File 'lib/sbmt/strangler/logger.rb', line 33

def log_success(message, **params)
  log_info(message, status: "success", **params)
end

#log_warn(message, **params) ⇒ Object



21
22
23
24
25
# File 'lib/sbmt/strangler/logger.rb', line 21

def log_warn(message, **params)
  with_tags(**params) do
    logger.warn(message)
  end
end

#with_tags(**params) ⇒ Object



41
42
43
44
45
# File 'lib/sbmt/strangler/logger.rb', line 41

def with_tags(**params)
  logger.tagged(**params) do
    yield
  end
end