Skip to content
Tim Watson edited this page Jul 12, 2012 · 1 revision

#Module systest_log#

Logging Event Handler - provides a gen_event based logging infrastructure which is very lightweight, at relatively low cost.

Behaviours: gen_event.

##Description## Whilst we aren't going to win any prizes for efficiency, we only deal with logging test related information, so we can probably afford to be relatively lazy here. This approach also enables us to remain basically framework agnostic, and does allow a user (in theory) to provide a custom log handler that delegates to their own logging framework of choice.

##Function Index##

activate_logging_subsystem/3
code_change/3
handle_call/2
handle_event/2
handle_info/2
init/1
log/2 Writes (with formatting as per log/3) to all logging handlers.
log/3 Writes to the logging handler Scope, formatting Fmt with Args.
start/0 Starts the default systest logging handler: 'system'.
start/3 Starts a log handler registered with Id, using the callback module Mod and the io-device (i.e., file descriptor or registered io handling process name) Output.
start_file/2 Starts a logging handler registered with 'Id', that outputs to File.
start_file/3 as start_file/2, but takes a callback module.
start_link/0
terminate/2
write_log/4

##Function Details##

###activate_logging_subsystem/3##

activate_logging_subsystem(SubSys, Id, LogBase) -> any()

###code_change/3##

code_change(OldVsn, State, Extra) -> any()

###handle_call/2##

handle_call(X1, State) -> any()

###handle_event/2##

handle_event(Message, State) -> any()

###handle_info/2##

handle_info(Info, State) -> any()

###init/1##

init(X1) -> any()

###log/2##

log(Fmt, Args) -> any()

Writes (with formatting as per log/3) to all logging handlers.

###log/3##

log(Scope, Fmt, Args) -> any()

Writes to the logging handler Scope, formatting Fmt with Args. This should work in much the same way as io:format/2 does, although this is implementation dependent to some extent.

###start/0##

start() -> any()

Starts the default systest logging handler: 'system'.

###start/3##

start(Id, Mod, Output) -> any()

Starts a log handler registered with Id, using the callback module Mod and the io-device (i.e., file descriptor or registered io handling process name) Output.

###start_file/2##

start_file(Id, File) -> any()

Starts a logging handler registered with 'Id', that outputs to File.

###start_file/3##

start_file(Id, Mod, Path) -> any()

as start_file/2, but takes a callback module.

###start_link/0##

start_link() -> any()

###terminate/2##

terminate(Reason, State) -> any()

###write_log/4##

write_log(EvId, Fd, What, Args) -> any()