Opaque logger class.
Configures the (global) logger. The argument name
is set only if
it is a valid id of character set [-0-9A-Z_a-z]
. The argument
source
shall be the name of the log source, usually the name of
the calling program.
If debug
is passed and .true.
, log messages of level LL_DEBUG
are forwarded via message queue. Otherwise, the minimum level for
logs to be transmitted is LL_INFO
. If ipc
is passed and
.true.
, logs are sent to the POSIX message queue of logger name
.
The name of the message queue is therefore /<name>
. Writing to
the message queue is blocking, unless blocking
is passed and
.false.
.
The dummy argument no_color
disables coloured output through ANSI
escape sequences if .true.
. Log messages are printed to standard
error, unless verbose
is passed and .false.
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
||
character(len=*), | intent(in), | optional | :: | name |
Logger name. |
|
character(len=*), | intent(in), | optional | :: | node_id |
Node id. |
|
character(len=*), | intent(in), | optional | :: | source |
Source (name of calling program). |
|
logical, | intent(in), | optional | :: | debug |
Forward debugging messages via IPC. |
|
logical, | intent(in), | optional | :: | ipc |
IPC through POSIX message queues. |
|
logical, | intent(in), | optional | :: | blocking |
Blocking IPC. |
|
logical, | intent(in), | optional | :: | no_color |
Disable ANSI colours. |
|
logical, | intent(in), | optional | :: | verbose |
Verbose output. |
Returns name of logger as allocatable string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
Logger name.
Returns .true.
if IPC is enabled.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
Prints log message to standard error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
||
type(log_type), | intent(inout) | :: | log |
Log to output. |
||
integer, | intent(in), | optional | :: | unit |
File unit. |
Sends a log message to the message queue (fire & forget). Only the
log level is validated. An invalid level is set to LL_ERROR
.
If error
is passed and E_NONE
, no log is created, unless
verbose
is set to .true.
. The passed log message is not
validated, but non-printable characters are escaped, unless escape
is passed and .false.
.
The length of argument message
is limited to LOG_MESSAGE_LEN
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
||
integer, | intent(in) | :: | level |
Log level. |
||
character(len=*), | intent(in) | :: | message |
Log message. |
||
character(len=*), | intent(in), | optional | :: | source |
Optional source of log. |
|
type(observ_type), | intent(inout), | optional | :: | observ |
Optional observation data. |
|
character(len=*), | intent(in), | optional | :: | timestamp |
Optional timestamp of log. |
|
integer, | intent(in), | optional | :: | error |
Optional error code. |
|
logical, | intent(in), | optional | :: | escape |
Escape non-printable characters in message ( |
|
logical, | intent(in), | optional | :: | verbose |
Create log if |
Sends a log data type to the message queue (send & forget). The
passed log is not validated and must have id, node id, and
timestamp. The receiver may decline the log if the data is
invalid. The log is forwarded even if the error code is E_NONE
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
||
type(log_type), | intent(inout) | :: | log |
Log type. |
Sends a critical log message to the message queue.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
||
character(len=*), | intent(in) | :: | message |
Log message. |
||
character(len=*), | intent(in), | optional | :: | source |
Optional source of log. |
|
type(observ_type), | intent(inout), | optional | :: | observ |
Optional observation data. |
|
character(len=*), | intent(in), | optional | :: | timestamp |
Optional timestamp of log. |
|
integer, | intent(in), | optional | :: | error |
Optional error code. |
|
logical, | intent(in), | optional | :: | escape |
Escape non-printable characters in message. |
|
logical, | intent(in), | optional | :: | verbose |
Create log if |
Sends a debugging log message to the message queue.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
||
character(len=*), | intent(in) | :: | message |
Log message. |
||
character(len=*), | intent(in), | optional | :: | source |
Optional source of log. |
|
type(observ_type), | intent(inout), | optional | :: | observ |
Optional observation data. |
|
character(len=*), | intent(in), | optional | :: | timestamp |
Optional timestamp of log. |
|
integer, | intent(in), | optional | :: | error |
Optional error code. |
|
logical, | intent(in), | optional | :: | escape |
Escape non-printable characters in message. |
|
logical, | intent(in), | optional | :: | verbose |
Create log if |
Sends a error log message to the message queue.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
||
character(len=*), | intent(in) | :: | message |
Log message. |
||
character(len=*), | intent(in), | optional | :: | source |
Optional source of log. |
|
type(observ_type), | intent(inout), | optional | :: | observ |
Optional observation data. |
|
character(len=*), | intent(in), | optional | :: | timestamp |
Optional timestamp of log. |
|
integer, | intent(in), | optional | :: | error |
Optional error code. |
|
logical, | intent(in), | optional | :: | escape |
Escape non-printable characters in message. |
|
logical, | intent(in), | optional | :: | verbose |
Create log if |
Sends a info log message to the message queue.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
||
character(len=*), | intent(in) | :: | message |
Log message. |
||
character(len=*), | intent(in), | optional | :: | source |
Optional source of log. |
|
type(observ_type), | intent(inout), | optional | :: | observ |
Optional observation data. |
|
character(len=*), | intent(in), | optional | :: | timestamp |
Optional timestamp of log. |
|
integer, | intent(in), | optional | :: | error |
Optional error code. |
|
logical, | intent(in), | optional | :: | escape |
Escape non-printable characters in message. |
|
logical, | intent(in), | optional | :: | verbose |
Create log if |
Sends a user-defined log message to the message queue.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
||
character(len=*), | intent(in) | :: | message |
Log message. |
||
character(len=*), | intent(in), | optional | :: | source |
Optional source of log. |
|
type(observ_type), | intent(inout), | optional | :: | observ |
Optional observation data. |
|
character(len=*), | intent(in), | optional | :: | timestamp |
Optional timestamp of log. |
|
integer, | intent(in), | optional | :: | error |
Optional error code. |
|
logical, | intent(in), | optional | :: | escape |
Escape non-printable characters in message. |
|
logical, | intent(in), | optional | :: | verbose |
Create log if |
Sends a warning log message to the message queue.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(logger_class), | intent(inout) | :: | this |
Logger object. |
||
character(len=*), | intent(in) | :: | message |
Log message. |
||
character(len=*), | intent(in), | optional | :: | source |
Optional source of log. |
|
type(observ_type), | intent(inout), | optional | :: | observ |
Optional observation data. |
|
character(len=*), | intent(in), | optional | :: | timestamp |
Optional timestamp of log. |
|
integer, | intent(in), | optional | :: | error |
Optional error code. |
|
logical, | intent(in), | optional | :: | escape |
Escape non-printable characters in message. |
|
logical, | intent(in), | optional | :: | verbose |
Create log if |