Module traces

Module gathering all code, common to tests and applications, that allows to lighten the trace macros, share defines and types, manage log handlers.

Description

Module gathering all code, common to tests and applications, that allows to lighten the trace macros, share defines and types, manage log handlers.

Data Types

aggregator_pid()

aggregator_pid() = class_TraceAggregator:aggregator_pid()

app_timestamp()

app_timestamp() = trace_utils:trace_timestamp()

bin_emitter_categorization()

bin_emitter_categorization() = bin_string()

For example <<"topics.sports.basketball">>.

bin_emitter_name()

bin_emitter_name() = bin_string()

Name of a trace emitter.

bin_location()

bin_location() = bin_string()

bin_message()

bin_message() = trace_utils:trace_bin_message()

An actual (binary) trace message.

bin_message_categorization()

bin_message_categorization() = trace_utils:trace_bin_message_categorization()

bin_string()

bin_string() = text_utils:bin_string()

bin_time()

bin_time() = bin_string()

A (binary) trace time.

emitter_any_categorization()

emitter_any_categorization() = emitter_categorization() | bin_emitter_categorization()

Any kind of categorization of a trace emitter.

emitter_categorization()

emitter_categorization() = ustring()

The categorization of a trace emitter.

It is a plain string listing increasingly detailed trace sub-categories, separated by dots.

For example "topics.sports.basketball".

emitter_info()

emitter_info() = {emitter_name(), emitter_categorization()}

emitter_name()

emitter_name() = ustring()

Name of a trace emitter.

file_name()

file_name() = file_utils:file_name()

handler_config()

handler_config() = logger:handler_config()

location()

location() = ustring()

The location (free text, typically host) of a trace emitter.

message()

message() = trace_utils:trace_message()

An actual trace message.

message_categorization()

message_categorization() = trace_utils:trace_message_categorization()

priority()

priority() = trace_utils:trace_priority()

Numerical version of the severity of a message.

time()

time() = ustring()

A trace time.

trace_severity()

trace_severity() = trace_utils:trace_severity()

Textual version of the severity of a message: 'emergency', 'alert', and all.

trace_supervision_type()

trace_supervision_type() = advanced_traces | {text_traces, trace_text_type()}

A trace type must be selected so that, when the traces are aggregated, the corresponding output is compliant with the tools to be used for supervision.

So the trace type to select depends on whether a dedicated, advanced trace tool should be used to browse the execution traces, or just a text viewer (possibly with a PDF displaying thereof); indeed it is:

- either 'advanced_traces', for traces typically expected to be read from the LogMX tool (relying then on our parser); see http://logmx.com/

- or {'text_traces', trace_text_type()}

trace_text_type()

trace_text_type() = text_only | pdf

Text traces are either in pure, raw text, or in PDF.

ustring()

ustring() = text_utils:ustring()

Function Index

add_handler/0Registers this Traces logger handler as an additional one (not replacing the default one), based on the (supposedly already-existing) trace aggregator.
add_handler/1Registers this Traces logger handler as an additional one (not replacing the default one), based on the specified trace aggregator.
check_pending_wooper_results/0Displays and flushes all remaining WOOPER results.
declare_beam_dirs_for_traces/0Declares automatically the relevant BEAM directories in the code path, so that Ceylan-Traces can be fully usable from then on.
get_execution_target/0
get_trace_filename/1Returns the name of the file in which traces will be written.
log/2Mandatory callback for log handlers.
manage_supervision/0Manages the supervision of traces, typically in an OTP context.
receive_applicative_message/0Receives an applicative, non-trace message, to shelter user messages from the trace ones.
receive_applicative_message/1Receives specified applicative, non-trace message, to shelter user messages from the trace ones.
reset_handler/0Unsets the Traces logger handler, returns to the base (Myriad's) trace_utils one.
set_handler/0Replaces the current (probably default) logger handler with this Traces one (registered as 'default'), based on the (supposedly already-existing) trace aggregator.
set_handler/1Replaces the current (probably default) logger handler with this Traces one (registered as 'default'), based on the specified trace aggregator.

Function Details

add_handler/0

add_handler() -> void()

Registers this Traces logger handler as an additional one (not replacing the default one), based on the (supposedly already-existing) trace aggregator.

add_handler/1

add_handler(AggregatorPid::aggregator_pid()) -> void()

Registers this Traces logger handler as an additional one (not replacing the default one), based on the specified trace aggregator.

check_pending_wooper_results/0

check_pending_wooper_results() -> void()

Displays and flushes all remaining WOOPER results.

Defined here, since uses a trace.

declare_beam_dirs_for_traces/0

declare_beam_dirs_for_traces() -> void()

Declares automatically the relevant BEAM directories in the code path, so that Ceylan-Traces can be fully usable from then on.

Note:

- the code_utils.beam module of Ceylan-Myriad must be available from the current code path

- the CEYLAN_MYRIAD, CEYLAN_WOOPER and CEYLAN_TRACES environment variables must be defined and must point to the respective root directories

- the determined directories are not specifically checked for existence, and are added at the end of the code path

get_execution_target/0

get_execution_target() -> development

get_trace_filename/1

get_trace_filename(ModuleName::basic_utils:module_name()) -> file_name()

Returns the name of the file in which traces will be written.

log/2

log(LogEvent::logger:log_event(), Config::handler_config()) -> void()

Mandatory callback for log handlers.

See https://erlang.org/doc/man/logger.html#HModule:log-2.

manage_supervision/0

manage_supervision() -> maybe(class_TraceSupervisor:supervisor_pid())

Manages the supervision of traces, typically in an OTP context.

In this context:

- the trace aggregator is expected to be already running

- by default no specific trace file can be defined by the user, as applications are just started or not

Note: currently not useful, as implicitly managed by traces_app:start/2.

receive_applicative_message/0

receive_applicative_message() -> any()

Receives an applicative, non-trace message, to shelter user messages from the trace ones.

receive_applicative_message/1

receive_applicative_message(Message::any()) -> void()

Receives specified applicative, non-trace message, to shelter user messages from the trace ones.

Used for synchronization purpose.

reset_handler/0

reset_handler() -> void()

Unsets the Traces logger handler, returns to the base (Myriad's) trace_utils one.

set_handler/0

set_handler() -> void()

Replaces the current (probably default) logger handler with this Traces one (registered as 'default'), based on the (supposedly already-existing) trace aggregator.

set_handler/1

set_handler(AggregatorPid::aggregator_pid()) -> void()

Replaces the current (probably default) logger handler with this Traces one (registered as 'default'), based on the specified trace aggregator.


Generated by EDoc