4.7.1 Library Log Reference
The library produce messages at different levels of verbosity.
- C Data Type: micro_benchmark_log_level {
MICRO_BENCHMARK_ERROR_LEVEL
, MICRO_BENCHMARK_WARNING_LEVEL
, MICRO_BENCHMARK_INFO_LEVEL
, MICRO_BENCHMARK_DEBUG_LEVEL
, MICRO_BENCHMARK_TRACE_LEVEL
} ¶
-
Levels used by the library (see Configuration).
The following functions control the logging output generated by the
library:
- C Log Function: void micro_benchmark_log_set_output (FILE *out) ¶
-
Preconditions:
- out is a valid
FILE
.
Effects:
- Use out to emit log messages.
Postconditions:
- out will receive the log messages emitted by the library up to
the next call to
micro_benchmark_log_set_output
or
micro_benchmark_log_reset_output
.
- C Log Function: void micro_benchmark_log_reset_output () ¶
-
Preconditions:
- None.
Effects:
- If
micro_benchmark_log_set_output
was called, stop using the
provided FILE *
.
- Use the default output to emit log messages.
Postconditions:
- The default output will receive the log messages emitted by the
library up to the next call to
micro_benchmark_log_set_output
.
- C Log Function: void micro_benchmark_set_log_level (micro_benchmark_log_level level) ¶
-
Preconditions:
- level is valid.
Effects:
- Set the log level to level.
Postconditions:
- The library won’t emit messages with less severity than level up
to the next call to micro_benchmark_set_log_level.
- C Log Function: void micro_benchmark_set_module_log_level (const char *module, micro_benchmark_log_level level) ¶
-
Preconditions:
- level is valid.
- module points to a valid, zero-ended array of characters.
Effects:
- Set the log level for module to level.
Postconditions:
- The library won’t emit messages of module with less severity
than level up to the next call to
micro_benchmark_set_log_level.