Class: Sbmt::Outbox::Logger

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

Instance Method Summary collapse

Instance Method Details

#log_debug(message, **params) ⇒ Object



8
9
10
11
12
# File 'lib/sbmt/outbox/logger.rb', line 8

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

#log_error(message, **params) ⇒ Object



20
21
22
23
24
# File 'lib/sbmt/outbox/logger.rb', line 20

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

#log_failure(message, **params) ⇒ Object



30
31
32
# File 'lib/sbmt/outbox/logger.rb', line 30

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

#log_info(message, **params) ⇒ Object



14
15
16
17
18
# File 'lib/sbmt/outbox/logger.rb', line 14

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

#log_success(message, **params) ⇒ Object



26
27
28
# File 'lib/sbmt/outbox/logger.rb', line 26

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

#with_tags(**params) ⇒ Object



34
35
36
37
38
# File 'lib/sbmt/outbox/logger.rb', line 34

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