elogger API
Overview Classes Cluster Class Index          Top Features

root_cluster.logging.appenders

Class ELOG_STDOUT_APPENDER


Direct ancestors

ELOG_APPENDER, KL_SHARED_STANDARD_FILES

Known direct descendants

ELOG_TEST_FAULTY_APPENDER

Creation

Features

Invariants

indexing

description

Standard output appender using io.put_string()

class ELOG_STDOUT_APPENDER

inherit

ELOG_APPENDER
KL_SHARED_STANDARD_FILES

create

make (new_name: STRING; synchronous: BOOLEAN)

-- Create new appender with name 'new_name'
-- Note: The appender is open by default,
-- is_blocking is set to True and
-- the layout is set to ELOG_SIMPLE_LAYOUT.
-- (From ELOG_APPENDER)

require

new_name_exists: new_name /= Void

feature -- Access

std: KL_STANDARD_FILES

-- Standard files
-- (From KL_SHARED_STANDARD_FILES)

ensure

std_not_void: Result /= Void

mutex_stdout: MUTEX

-- global mutex on all ELOG_STDOUT_APPENDER objects

feature -- Removal

dispose

-- Close this appender when garbage collected. Perform
-- minimal operations to release resources. Do not call
-- other object as they may have been garbage collected.
-- (From DISPOSABLE)

feature -- Output

write_footer

-- write the layout footer to the appender
-- Note: This is done synchronously
-- (From ELOG_APPENDER)

require

footer_not_void: layout.footer /= Void

write_header

-- write the layout header to the appender
-- Note: this is done synchronously.
-- (From ELOG_APPENDER)

require

header_not_void: layout.header /= Void

feature {ELOG_LOGGER, ELOG_DISPATCHER, ELOG_APPENDER, TS_TEST_CASE} -- Output

append (event: ELOG_EVENT)

-- Log event on this appender (front end).
-- (From ELOG_APPENDER)

require

event_exists: event /= Void
is_open: is_open

feature -- Status Report

backup_appender: ELOG_APPENDER

-- if something goes wrong, use this appender.
-- (From ELOG_APPENDER)

backup_appender_timeout: INTEGER

-- timeout after which we retry this appender again after
-- a failure. this value starts from Start_backup_appender_timeout,
-- and doubles with each time the appender did not work.
-- e.g. 100ms, 200ms, 400ms, 800ms ... etc
-- (From ELOG_APPENDER)

backup_appender_timeout_max: INTEGER

-- The maximum time the timeout grows to. If this value is 0,
-- then the 'backup_appender_timeout' will grow unboundedly.
-- (until INTEGER_32.max is reached, which is 24 days)
-- (From ELOG_APPENDER)

backup_appender_timeout_min: INTEGER

-- The start of the timeout counter, e.g. 100 ms.
-- see 'backup_appender_timeout' for more information.
-- (From ELOG_APPENDER)

buffer_size: INTEGER

-- The maximum size of 'event_pool' in number
-- of elements. If this value is zero, there is
-- no limit to the buffer size (except the memory
-- available).
-- (From ELOG_APPENDER)

is_blocking: BOOLEAN

-- is the buffer blocking if it is full?
-- if it isn't, the events are summarized
-- and discarded.
-- (From ELOG_APPENDER)

is_open: BOOLEAN

-- Is the appender open for appending?
-- (From ELOG_APPENDER)

is_synchronous: BOOLEAN

-- Are the events beeing logged synchronously?
-- (From ELOG_APPENDER)

layout: ELOG_LAYOUT

-- Layout used to format events for this appender. May be Void
-- if no layout is used.
-- (From ELOG_APPENDER)

name: STRING

-- Name of this appender that uniquely
-- identifies it.
-- (From ELOG_APPENDER)

use_backup_appender: BOOLEAN

-- use backup_appender instead
-- (From ELOG_APPENDER)

feature -- Status Setting

close

-- Release of resources.
-- (From ELOG_APPENDER)

initialize_mutex

-- initialize the mutexes
-- (From ELOG_APPENDER)

set_asynchronous

-- sets 'is_synchronous' to False.
-- (From ELOG_APPENDER)

set_backup_appender (a_appender: ELOG_APPENDER; pass_settings: BOOLEAN)

-- sets 'backup_appender'
-- if pass_settings is true, all the settings
-- will be passed on.
-- (From ELOG_APPENDER)

ensure

no_cycle: not check_for_backup_cycle

set_backup_appender_timeout_max (a_backup_appender_timeout_max: INTEGER)

-- sets 'backup_appender_timeout_max' in milliseconds.
-- (From ELOG_APPENDER)

require

a_backup_appender_valid: a_backup_appender_timeout_max > backup_appender_timeout

set_backup_appender_timeout_min (a_backup_appender_timeout: INTEGER)

-- sets 'backup_appender_timeout' in milliseconds.
-- (From ELOG_APPENDER)

require

a_backup_appender_valid: a_backup_appender_timeout > 0 and a_backup_appender_timeout <= backup_appender_timeout_max

set_blocking (flag: BOOLEAN)

-- sets 'is_blocking'
-- (From ELOG_APPENDER)

set_buffer_size (size: INTEGER)

-- sets the maximal buffer size to 'size'.
-- (From ELOG_APPENDER)

set_filter (a_filter: ELOG_FILTER)

-- Set 'filter' to 'a_filter'. See ELOG_AND_FILTER or
-- ELOG_OR_FILTER on how to set multiple filters.
-- If a_filter is void, no filter will be used.
-- (From ELOG_APPENDER)

set_layout (new_layout: ELOG_LAYOUT)

-- Set the layout that this appender should use.
-- (From ELOG_APPENDER)

require

layout_exists: new_layout /= Void

set_name (new_name: STRING)

-- Set the name of this appender
-- (From ELOG_APPENDER)

require

name_exists: new_name /= Void

set_synchronous_force

-- sets 'is_synchronous' to True.
-- If the buffer still contains elements,
-- it will be emptied and the events discarded.
-- (From ELOG_APPENDER)

set_synchronous_wait

-- sets 'is_synchronous' to True.
-- If the buffer still contains elements, we wait
-- here until the pool is empty.
-- (From ELOG_APPENDER)

set_use_backup_appender (use_backup: BOOLEAN; current_event: ELOG_EVENT)

-- sets to use backup appender
-- this can be called from the dispatcher or the appender
-- (From ELOG_APPENDER)

wait (is_monitor_locked: BOOLEAN)

-- wait here until the consumer thread
-- has finished dispatching the events.
-- (From ELOG_APPENDER)

require

is_asynchronous: not is_synchronous

feature {ELOG_DISPATCHER} -- Implementation

append_monitor: ELOG_MUTEX

-- monitor used for synchronizing events
-- (From ELOG_APPENDER)

do_append (event: ELOG_EVENT)

-- Append 'event' to this appender.
-- (From ELOG_APPENDER)

require

event_exists: event /= Void
is_open: is_open

monitor: ELOG_MUTEX

-- monitor used for synchronizing events
-- (From ELOG_APPENDER)

invariant

-- From ELOG_APPENDER
layout_not_void: layout /= Void
buffer_size_non_negative: buffer_size >= 0
backup_appender_set: use_backup_appender implies backup_appender /= Void
event_pool_has_consumer_1: event_pool = Void implies consumer_thread = Void
event_pool_has_consumer_2: event_pool /= Void implies consumer_thread /= Void
event_pool_exists: (is_open and not is_synchronous) implies event_pool /= Void
backup_appender_timeout_valid: backup_appender_timeout > 0
backup_appender_timeout_max_valid: backup_appender_timeout_max >= backup_appender_timeout

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

Documentation generated by edoc