Classes Clusters Cluster hierarchy Relations Contracts Flat contracts Go to:
indexing description: "Logging logger." project: "Project Goanna <http://sourceforge.net/projects/goanna>" library: "log4e" date: "$Date$" revision: "$Revision$" author: "Glenn Maughan <glennmaughan@goanna.info>" copyright: "Copyright (c) 2002 Glenn Maughan" license: "Eiffel Forum License v1 (see forum.txt)." class interface L4E_LOGGER create make (hierarchy: L4E_HIERARCHY; cat_name: STRING) -- Create new logger with 'cat_name' require cat_name_exists: cat_name /= void ensure context_set: context = hierarchy name_set: name = cat_name additive: is_additive feature -- Comparison is_equal (other: like Current): BOOLEAN -- Is other attached to an object of the same type -- as current object and identical to it? -- (from COMPARABLE) require -- from ANY other_not_void: other /= void ensure -- from ANY symmetric: Result implies other.is_equal (Current) consistent: standard_is_equal (other) implies Result ensure then -- from COMPARABLE trichotomy: Result = (not (Current < other) and not (other < Current)) max (other: like Current): like Current -- The greater of current object and other -- (from COMPARABLE) require -- from COMPARABLE other_exists: other /= void ensure -- from COMPARABLE current_if_not_smaller: Current >= other implies Result = Current other_if_smaller: Current < other implies Result = other min (other: like Current): like Current -- The smaller of current object and other -- (from COMPARABLE) require -- from COMPARABLE other_exists: other /= void ensure -- from COMPARABLE current_if_not_greater: Current <= other implies Result = Current other_if_greater: Current > other implies Result = other three_way_comparison (other: like Current): INTEGER -- If current object equal to other, 0; -- if smaller, -1; if greater, 1 -- (from COMPARABLE) require -- from COMPARABLE other_exists: other /= void ensure -- from COMPARABLE equal_zero: (Result = 0) = is_equal (other) smaller_negative: (Result = - 1) = (Current < other) greater_positive: (Result = 1) = (Current > other) infix "<" (other: like Current): BOOLEAN -- Is current object less than other? require -- from PART_COMPARABLE other_exists: other /= void ensure then -- from COMPARABLE asymmetric: Result implies not (other < Current) infix "<=" (other: like Current): BOOLEAN -- Is current object less than or equal to other? -- (from COMPARABLE) require -- from PART_COMPARABLE other_exists: other /= void ensure then -- from COMPARABLE definition: Result = ((Current < other) or is_equal (other)) infix ">" (other: like Current): BOOLEAN -- Is current object greater than other? -- (from COMPARABLE) require -- from PART_COMPARABLE other_exists: other /= void ensure then -- from COMPARABLE definition: Result = (other < Current) infix ">=" (other: like Current): BOOLEAN -- Is current object greater than or equal to other? -- (from COMPARABLE) require -- from PART_COMPARABLE other_exists: other /= void ensure then -- from COMPARABLE definition: Result = (other <= Current) feature -- Constants Debug_int: INTEGER is 10000 -- (from L4E_PRIORITY_CONSTANTS) debug_p: L4E_PRIORITY -- Debug priority designates fine-grained -- informational events that are most useful -- to debug an application. -- (from L4E_PRIORITY_CONSTANTS) Error_int: INTEGER is 40000 -- (from L4E_PRIORITY_CONSTANTS) error_p: L4E_PRIORITY -- Error priority designates error events. -- (from L4E_PRIORITY_CONSTANTS) Fatal_int: INTEGER is 50000 -- (from L4E_PRIORITY_CONSTANTS) fatal_p: L4E_PRIORITY -- Fatal priority designates very severe error events -- that will presumably lead the application to abort. -- (from L4E_PRIORITY_CONSTANTS) Info_int: INTEGER is 20000 -- (from L4E_PRIORITY_CONSTANTS) info_p: L4E_PRIORITY -- Info priority designates informational -- messages that highlight the progress of -- the application at coarse-grained level. -- (from L4E_PRIORITY_CONSTANTS) Warn_int: INTEGER is 30000 -- (from L4E_PRIORITY_CONSTANTS) warn_p: L4E_PRIORITY -- Warn priority designates potentially -- harmful situations. -- (from L4E_PRIORITY_CONSTANTS) feature -- Logging debugging (message: ANY) -- Log a message object with the priority Debug. -- First checks if this logger is enabled -- by comparing the priority of this logger -- with the Debug priority. If this logger -- is debug enabled, then it converts the -- message object to a string by invoking -- 'out'. It then proceeds to call all the -- registered appenders in this logger and -- also higher in the hierarchy depending on -- the value of the additivity flag. require message_exists: message /= void error (message: ANY) -- Log a message object with the priority Error. -- First checks if this logger is enabled -- by comparing the priority of this logger -- with the Error priority. If this logger -- is info enabled, then it converts the -- message object to a string by invoking -- 'out'. It then proceeds to call all the -- registered appenders in this logger and -- also higher in the hierarchy depending on -- the value of the additivity flag. require message_exists: message /= void fatal (message: ANY) -- Log a message object with the priority Fatal. -- First checks if this logger is enabled -- by comparing the priority of this logger -- with the Fatal priority. If this logger -- is error enabled, then it converts the -- message object to a string by invoking -- 'out'. It then proceeds to call all the -- registered appenders in this logger and -- also higher in the hierarchy depending on -- the value of the additivity flag. require message_exists: message /= void info (message: ANY) -- Log a message object with the priority Info. -- First checks if this logger is enabled -- by comparing the priority of this logger -- with the Info priority. If this logger -- is info enabled, then it converts the -- message object to a string by invoking -- 'out'. It then proceeds to call all the -- registered appenders in this logger and -- also higher in the hierarchy depending on -- the value of the additivity flag. require message_exists: message /= void log (event_priority: L4E_PRIORITY; message: ANY) -- Log a general message. require event_priority_exists: event_priority /= void message_exists: message /= void warn (message: ANY) -- Log a message object with the priority Warn. -- First checks if this logger is enabled -- by comparing the priority of this logger -- with the Warn priority. If this logger -- is warn enabled, then it converts the -- message object to a string by invoking -- 'out'. It then proceeds to call all the -- registered appenders in this logger and -- also higher in the hierarchy depending on -- the value of the additivity flag. require message_exists: message /= void feature -- Status Report appenders: DS_LINKED_LIST [L4E_APPENDER] -- Appenders for this logger. context: L4E_HIERARCHY -- The hierarchy in which this logger operates. is_additive: BOOLEAN -- Should appenders of this logger's parent be used? is_enabled_for (check_priority: L4E_PRIORITY): BOOLEAN -- Is this logger enabled for 'check_priority'? require check_priority_exists: check_priority /= void ensure true_if_priority_enabled: Result = (context.disabled < check_priority.level and priority <= check_priority) is_priority_set: BOOLEAN -- Does this logger have a priority set? False if the priority -- will be inherited from an ancestor. name: STRING -- Name of this logger parent: L4E_LOGGER -- The parent of this logger. priority: L4E_PRIORITY -- Starting from this caregory, search the logger -- hieararchy for a non-null priority and return it. -- Otherwise, return the priority of the root logger. feature -- Status Setting add_appender (new_appender: L4E_APPENDER) -- Add 'new_appender' to the list of -- appenders for this logger. require new_appender_exists: new_appender /= void not_added: not appenders.has (new_appender) ensure appender_added: appenders.has (new_appender) call_appenders (event: L4E_EVENT) -- Send 'event' to all appenders of this -- logger and recursively parents appenders if -- additive. require event_exists: event /= void close_appenders -- Close all appenders remove_appender (appender_name: STRING) -- Remove appender with name 'appender_name' -- Iterates to find matching appender. require name_exists: appender_name /= void set_additive (flag: BOOLEAN) -- Set additive status to 'flag'. set_priority (new_priority: L4E_PRIORITY) -- Set the priority for this logger. Pass Void to unset the -- priority and use an ancestor's. require priority_exists: new_priority /= void invariant name_exists: name /= void and then not name.is_empty appenders_exist: appenders /= void -- from ANY reflexive_equality: standard_is_equal (Current) reflexive_conformance: conforms_to (Current) -- from COMPARABLE irreflexive_comparison: not (Current < Current) end -- class L4E_LOGGER
Classes Clusters Cluster hierarchy Relations Contracts Flat contracts Go to:

Goanna Log4E -- Copyright © 2002 Glenn Maughan