Last modified on 30 August 2010, at 15:55

Aros/Developer/Docs/Logging

This is currently a draft page ...

Logging Subsystem ComponentsEdit

log.resource  
Generic API to logging.
debug.logger  
hardcoded processor for debug log output. used for
other log types until exec can handle memory requests.
generic.logger  
hardcoded processor used after log.resource:init() to process all but debug logging.
NB -: should not be used inside allocmem/freemem (since it may use them) or IRQs


seriallog.resource  
rom resident listener which dumps DEBUG type log output to the serial device
(configurable via grub command line)


Support CommandsEdit

C
BufferLog LOGTYPE OUTPUTFILE
Registers a listener for the specified LOGTYPE which Buffers log output to an OUTPUTFILE.
SYS
Tools/LogViewer LOGFILE
Tool used to display LOGFILE's buffered with C:BufferLog.

Logging Subsystem OperationsEdit

Logging API'sEdit

LOG_TYPEID
LOG_DATA
LOG_TYPE_DEBUG
DEBUG_ERROR
DEBUG_WARN
DEBUG_INFO
LOG_TYPE_SYSTEM
SYSTEM_ERROR
SYSTEM_WARN
SYSTEM_INFO
LOG_TYPE_APPLICATION
APPLICATION_ERROR
APPLICATION_WARN
APPLICATION_INFO


IPTR LOGR_RegisterProcessor(LOG_TYPEID, struct LogProcessor *)

IPTR LOGR_RegisterListener(LOG_TYPEID, struct LogListener *)

BOOL LOGR_LogEvent(LOG_TYPEID, LOG_DATA, char *LOG_SRC, char *LOG_TEMPLATE, args ...)

IPTR LOGR_ObtainLogEvents(LOG_TYPEID, LOG_EVENTFLAGS)

IPTR LOGR_LogEventNext(IPTR)

IPTR LOGR_LogEventDelete(IPTR)

IPTR LOGR_ReleaseLogEvents(IPTR)


LOGR_RegisterProcessorEdit

LOGR_RegisterListenerEdit

LOGR_LogEventEdit

Used to output data to a specified log.

LOGR_ObtainLogEventsEdit

Returns a per caller handle. if (LOG_EVENTFLAGS == LOG_EVENTLIST_UNIQUE) then it will only succeed if no other access is occurring.

internal: sets handle->active_event to the first log entry and increases its access count.

LOGR_LogEventNextEdit

(semaphore protected?)

internal: sets handle->active_event to the next log entry - decreasing the current one's access count and increasing the next's access count

LOGR_LogEventDeleteEdit

(semaphore protected?)

Deletes a log entry.

internal: deletes handle->active_event - or marks it for deletion if its access count > 0

LOGR_ReleaseLogEventsEdit

Must be called with a handle obtained with LOGR_ObtainLogEvents. decreases the handle->active_event's access count, and frees the per caller handle.