Crate coaly

Source
Expand description

Coaly is a library for handling log and trace messages. Besides the usual levels indicating message severity it offers various formatting options and supports files, memory mapped files and remote servers over network as output resource. Advanced features are output buffering in main memory and configurable behaviour dependent on the location in the code. E.g. for one module or function all levels may be switched off, whereas for another messages of all levels are included in the output. The behaviour is entirely specified in a configuration file that is read once at application start and cannot be changed during runtime.

Re-exports§

pub use errorhandling::CoalyException;

Modules§

agent
The local agent is the central trace and log management instance within a process.
collections
Special collection types for Coaly.
config
Coaly configuration handling.
errorhandling
Common exceptions for all parts of Coaly.
net
Functionality needed by network resources and log/trace server.
observer
Coaly observer types
output
Top level module for output handling.
util
Utility functions.

Macros§

coalyxe
Raise an exception with severity error
coalyxw
Raise an exception with severity warning
logalert
Writes a log message with level alert.
logcrit
Writes a log message with level critical.
logdebug
Writes a trace message with level debug.
logemgcy
Writes a log message with level emergency.
logerror
Writes a log message with level error.
logfn
Traces a function’s boundaries. Writes immediately a record upon the entry of the function and another message upon leaving of the function using the drop method of the instantiated Coaly observer structure. Depending on the configuration, the system’s behaviour may change after the function entry. Function parameters can optionally be traced by additional arguments separated with a comma. Each argument value must be convertible to a string.
loginfo
Writes a log message with level information.
logmod
Traces a module’s boundaries. Writes immediately a record upon the entry of the module and another message upon leaving of the module using the drop method of the instantiated Coaly observer structure. Depending on the configuration, the system’s behaviour may change after the module entry.
lognote
Writes a trace message with level notice.
logobj
Writes a log message concerning the specified application object. Object level is used for the message. The application object must implement the CoalyObservable trait.
logwarn
Writes a log message with level warning.
newcoalyobs
Creates and returns an observer structure. Writes immediately an output record upon instantiation of the structure and another record upon drop. Depending on the configuration, the system’s behaviour may change after the structure instantiation.

Structs§

CoalyObserver
Coaly observer structure. An observer structure is created upon entry of a function or during instantiation of a logging relevant user structure. An observer structure marks both beginning and end of a function or structure lifetime, it is the basis for output mode control.
OriginatorInfo
Information about the originator of a log or trace message when sent to a remote server. Also used locally to replace variables used in record formats or file names with their actual values.

Enums§

RecordLevelId
Record level ID enumeration. Used as key in record level table.

Traits§

CoalyObservable

Functions§

initialize
Initializes the system.
shutdown
Terminates the system.

Type Aliases§

CoalyResult
Result type used throughout the library for error handling