elogger API
Overview Classes Cluster Class Index          Top Features

root_cluster.logging

Class ELOG_HIERARCHY


Direct ancestors

ELOG_SEVERITY_CONSTANTS

Creation

Features

Invariants

indexing

description

The hierarchy containing all the loggers. This is the main interface to be used.

class ELOG_HIERARCHY

inherit

ELOG_SEVERITY_CONSTANTS

create

make (severity: ELOG_SEVERITY)

-- Create a logger hierarchy with a
-- root logger with severity 'severity'.

ensure

not_disabled: disabled = Disable_off

feature -- Initialisation

make (severity: ELOG_SEVERITY)

-- Create a logger hierarchy with a
-- root logger with severity 'severity'.

ensure

not_disabled: disabled = Disable_off

feature -- Access

get_severity_from_string (a_string: STRING): ELOG_SEVERITY

-- returns a severity from the given string (if valid)
-- (From ELOG_SEVERITY_CONSTANTS)

feature -- Constants

Critical_int: INTEGER_8

Critical_severity: ELOG_SEVERITY

-- Critical must be used to indicate that
-- an immediate action is needed and the
-- scope is broad (perhaps an imminent
-- outage to a critical resource will
-- result).
-- (From ELOG_SEVERITY_CONSTANTS)

Critical_string: STRING

Disabled_int: INTEGER_8

Disabled_severity: ELOG_SEVERITY

-- Do not use this severity for log messages.
-- only use it to disable loggers.
-- (From ELOG_SEVERITY_CONSTANTS)

Disabled_string: STRING

Fatal_int: INTEGER_8

Fatal_severity: ELOG_SEVERITY

-- Fatal must be used to indicate that an
-- error occurred, but it is too late
-- to take remedial action
-- (From ELOG_SEVERITY_CONSTANTS)

Fatal_string: STRING

Harmless_int: INTEGER_8

Harmless_severity: ELOG_SEVERITY

-- Harmless must be used for cases in which
-- the error event has no effect on the normal
-- operation of the resource.
-- (From ELOG_SEVERITY_CONSTANTS)

Harmless_string: STRING

Information_int: INTEGER_8

Information_severity: ELOG_SEVERITY

-- Information must be used for cases when the
-- event contains only general information and
-- is not reporting an error.
-- (From ELOG_SEVERITY_CONSTANTS)

Information_string: STRING

Max_severity_int: INTEGER_8

Minor_int: INTEGER_8

Minor_severity: ELOG_SEVERITY

-- Minor must be used to indicate that
-- action is needed, but the situation
-- is not serious at this time.
-- (From ELOG_SEVERITY_CONSTANTS)

Minor_string: STRING

Unknown_int: INTEGER_8

Unknown_severity: ELOG_SEVERITY

-- Use this severity only if you are unsure
-- about the events severity. This is the
-- lowest possible severity.
-- (From ELOG_SEVERITY_CONSTANTS)

Unknown_string: STRING

Warning_int: INTEGER_8

Warning_severity: ELOG_SEVERITY

-- Warning must be used when it is appropriate
-- to let the user decide if an action is
-- needed in response to the event.
-- (From ELOG_SEVERITY_CONSTANTS)

Warning_string: STRING

feature -- Logger Factory

all_loggers: DS_LIST[ELOG_LOGGER]

-- Return list of all current loggers. Root logger will be first in list

logger (logger_name: STRING): ELOG_LOGGER

-- Return a logger for 'name'. Initialise a new
-- logger instance if necessary.

require

logger_name_exists: logger_name /= Void and then not logger_name.is_empty
no_start_or_end_dots: logger_name.item (1) /= '.' and then logger_name.item (logger_name.count) /= '.'
no_consecutive_dots: logger_name.substring_index ("..", 1) = 0

ensure

logger_exists: has (logger_name)

feature -- Status Report

Disable_off: INTEGER

-- Severity disabled off

disabled: INTEGER

-- Globally disabled severity level. Disable_off if no priorities
-- are disabled. Everything lower or equal than this
-- value will be disabled (less important).

has (name: STRING): BOOLEAN

-- Does a logger with 'name' exist in this hierarchy?

require

name_exists: name /= Void

is_enabled_for (severity: ELOG_SEVERITY): BOOLEAN

-- Is 'severity' level logging enabled for this hierarchy?

root: ELOG_LOGGER

-- Root logger of this hierarchy

start_time: DT_DATE_TIME

-- time the hierarchy was created

feature -- Status Setting

clear

-- Clear all loggers from this hierarchy

close_all

-- Close all appenders for all loggers in this
-- hierarchy.

disable (severity: ELOG_SEVERITY)

-- Disable all logging for level 'severity'

require

severity_exists: severity /= Void

ensure

severity_disabled: disabled = severity.level

disable_all

-- Disable all logging.

disable_critical

-- Disable critical logging.

disable_fatal

-- Disable fatal logging.

disable_harmless

-- Disable harmless logging.

disable_information

-- Disable Information logging.

disable_minor

-- Disable minor logging.

disable_unknown

-- Disable Unknown logging.

disable_warning

-- Disable warning logging.

enable_all

-- Enable all logging.

load_hierarchy (h: ELOG_HIERARCHY)

-- load the settings of the given hierarchy
-- Note: This will not delete loggers, only change
-- settings of existing loggers and add new loggers

require

h_not_void: h /= Void

feature {ELOG_HIERARCHY} -- Implementation

initialize_mutex

-- initialize the mutex (used after receiving a hierarchy)

invariant

tree_is_valid: invariant_tree_is_valid
loggers_not_void: loggers /= Void
has_root: loggers.has (Root_logger_name)

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

Documentation generated by edoc