class Jellog::Config

This class defines the parameters that the {Jellog::Logger} expects when creating an instance. You can inherit from this class to include these parameters automatically in your own config class, e.g. for an application that uses Jellog:

For example:

module MyApplication
  class Config < Jellog::Options
    # define your parameter methods here
  end
end

@see file:lib/jellog/config.md Jellog Parameter Descriptions

Public Instance Methods

configure_disable_syslog(bool) click to toggle source
# File lib/jellog/config.rb, line 127
def configure_disable_syslog(bool)
  default false
  comment "Set to true to prevent system log calls from logging to syslog as well"
  a_boolean(bool)
end
configure_log_coloured(bool) click to toggle source
# File lib/jellog/config.rb, line 93
def configure_log_coloured(bool)
  default true
  comment "Set to false to suppress colourful logging. Default colours can be changed by calling",
    "#colours= method"
  a_boolean(bool)
end
configure_log_date_time_format(format) click to toggle source
# File lib/jellog/config.rb, line 102
def configure_log_date_time_format(format)
  default "%Y-%m-%d %H:%M:%S"
  comment "Format string for time stamps. Needs to be a string that is recognised by String#strftime",
    "Any characters not recognised by strftime will be printed verbatim, which may not be what you want"
    
  a_string(format)
end
configure_log_dir(dir) click to toggle source
# File lib/jellog/config.rb, line 38
def configure_log_dir(dir)
  default '/var/log/jerbil'
  comment "Path to a writeable directory where Jellog will save log files."

  a_writable_dir(dir)
end
configure_log_length(int) click to toggle source
# File lib/jellog/config.rb, line 73
def configure_log_length(int)
  default 1 #Mbyte
  comment "Size of a log file (in MB) before switching to the next log, upto 20 MB"

  a_type_of(int, Integer) && in_range(int, 1, 20)
  int * 1024 * 1024
end
configure_log_level(lvl) click to toggle source
# File lib/jellog/config.rb, line 47
def configure_log_level(lvl)
  default :system
  comment "Controls the amount of logging done by Jellog",
    "",
    " * :system - standard message, plus log to syslog",
    " * :verbose - more generous logging to help resolve problems",
    " * :debug - usually used only for resolving problems during development",
    ""

  lvl_set = [:system, :verbose, :debug]
  a_member_of(lvl, lvl_set)

end
configure_log_mark(m_str) click to toggle source
# File lib/jellog/config.rb, line 121
def configure_log_mark(m_str)
  default "   ===== Mark ====="
  comment "Set the string to be used for marking the log with logger.mark"
  a_string(m_str)
end
configure_log_reset(bool) click to toggle source
# File lib/jellog/config.rb, line 84
def configure_log_reset(bool)
  default false
  comment "Reset the logfile when starting logging by setting to true, otherwise append to",
    "existing log"
  a_boolean(bool)
end
configure_log_rotation(int) click to toggle source
# File lib/jellog/config.rb, line 63
def configure_log_rotation(int)
  default 2
  comment "Number of log files to retain at any time, between 0 and 20"

  a_type_of(int, Integer) && in_range(int, 0, 20)

end
configure_log_sync(bool) click to toggle source
# File lib/jellog/config.rb, line 112
def configure_log_sync(bool)
  default true
  comment "Setting to true (the default) will flush log messages immediately, which is useful if you",
    "need to monitor logs dynamically"
  a_boolean(bool)
end