Class: Splash::Loggers::Dual

Inherits:
Object
  • Object
show all
Includes:
Config
Defined in:
lib/splash/loggers/dual.rb

Overview

Dual multiplexer specific logger log against CLi and Daemon

Constant Summary

Constants included from Constants

Constants::AUTHOR, Constants::BACKENDS_STRUCT, Constants::CONFIG_FILE, Constants::COPYRIGHT, Constants::DAEMON_LOGMON_SCHEDULING, Constants::DAEMON_METRICS_SCHEDULING, Constants::DAEMON_PID_FILE, Constants::DAEMON_PROCESS_NAME, Constants::DAEMON_PROCMON_SCHEDULING, Constants::DAEMON_STDERR_TRACE, Constants::DAEMON_STDOUT_TRACE, Constants::DEFAULT_RETENTION, Constants::EMAIL, Constants::EXECUTION_TEMPLATE, Constants::EXECUTION_TEMPLATE_TOKENS_LIST, Constants::LICENSE, Constants::LOGGERS_STRUCT, Constants::PID_PATH, Constants::PROMETHEUS_ALERTMANAGER_URL, Constants::PROMETHEUS_PUSHGATEWAY_URL, Constants::PROMETHEUS_URL, Constants::TRACE_PATH, Constants::TRANSPORTS_STRUCT, Constants::VERSION, Constants::WEBADMIN_IP, Constants::WEBADMIN_PID_FILE, Constants::WEBADMIN_PID_PATH, Constants::WEBADMIN_PORT, Constants::WEBADMIN_PROCESS_NAME, Constants::WEBADMIN_PROXY, Constants::WEBADMIN_STDERR_TRACE, Constants::WEBADMIN_STDOUT_TRACE

Instance Method Summary collapse

Methods included from Config

#get_config, #rehash_config

Methods included from ConfigUtilities

#addservice, #checkconfig, #flush_backend, #setupsplash

Methods included from Helpers

#check_unicode_term, #daemonize, #format_by_extensions, #format_response, #get_processes, #group_root, #install_file, #is_root?, #make_folder, #make_link, #run_as_root, #search_file_in_gem, #user_root, #verify_file, #verify_folder, #verify_link, #verify_service

Constructor Details

#initializeDual

Constructor build two attributes for each loggers : Cli, Daemon



29
30
31
32
33
# File 'lib/splash/loggers/dual.rb', line 29

def initialize
  super
  @log1 = Splash::Loggers::Cli::new
  @log2 = Splash::Loggers::Daemon::new
end

Instance Method Details

#levelSymbol

getter for root level

Returns:

  • (Symbol)

    a level



42
43
44
# File 'lib/splash/loggers/dual.rb', line 42

def level
  @level
end

#level=(level) ⇒ Object

setter for global level, both Cli and Daemon

Parameters:

  • level (Symbol)

    a level in Splash::Loggers::LEVELS or Splash::Loggers::ALIAS



48
49
50
51
52
# File 'lib/splash/loggers/dual.rb', line 48

def level=(level)
  @level = level
  @log1.level=level
  @log2.level=level
end

#log(options) ⇒ Object



35
36
37
38
# File 'lib/splash/loggers/dual.rb', line 35

def log(options)
  @log1.log options
  @log2.log options
end