Module: OpenSearch::Loggable

Included in:
Transport::Transport::Base
Defined in:
lib/opensearch/transport/transport/loggable.rb

Overview

Module to encapsulate all logging functionality.

Since:

  • 7.0.0

Instance Method Summary collapse

Instance Method Details

#log_debug(message) ⇒ Object

Log a debug message.

Examples:

Log a debug message.

log_debug('Message')

Parameters:

  • message (String)

    The message to log.

Since:

  • 7.0.0



42
43
44
# File 'lib/opensearch/transport/transport/loggable.rb', line 42

def log_debug(message)
  logger.debug(message) if logger && logger.debug?
end

#log_error(message) ⇒ Object

Log an error message.

Examples:

Log an error message.

log_error('Message')

Parameters:

  • message (String)

    The message to log.

Since:

  • 7.0.0



54
55
56
# File 'lib/opensearch/transport/transport/loggable.rb', line 54

def log_error(message)
  logger.error(message) if logger && logger.error?
end

#log_fatal(message) ⇒ Object

Log a fatal message.

Examples:

Log a fatal message.

log_fatal('Message')

Parameters:

  • message (String)

    The message to log.

Since:

  • 7.0.0



66
67
68
# File 'lib/opensearch/transport/transport/loggable.rb', line 66

def log_fatal(message)
  logger.fatal(message) if logger && logger.fatal?
end

#log_info(message) ⇒ Object

Log an info message.

Examples:

Log an info message.

log_info('Message')

Parameters:

  • message (String)

    The message to log.

Since:

  • 7.0.0



78
79
80
# File 'lib/opensearch/transport/transport/loggable.rb', line 78

def log_info(message)
  logger.info(message) if logger && logger.info?
end

#log_warn(message) ⇒ Object

Log a warn message.

Examples:

Log a warn message.

log_warn('Message')

Parameters:

  • message (String)

    The message to log.

Since:

  • 7.0.0



90
91
92
# File 'lib/opensearch/transport/transport/loggable.rb', line 90

def log_warn(message)
  logger.warn(message) if logger && logger.warn?
end