Next: , Up: Utilities Reference   [Contents][Index]


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:

  1. out is a valid FILE.

Effects:

  1. Use out to emit log messages.

Postconditions:

  1. 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:

  1. None.

Effects:

  1. If micro_benchmark_log_set_output was called, stop using the provided FILE *.
  2. Use the default output to emit log messages.

Postconditions:

  1. 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:

  1. level is valid.

Effects:

  1. Set the log level to level.

Postconditions:

  1. 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:

  1. level is valid.
  2. module points to a valid, zero-ended array of characters.

Effects:

  1. Set the log level for module to level.

Postconditions:

  1. The library won’t emit messages of module with less severity than level up to the next call to micro_benchmark_set_log_level.



Next: Optimization Utilities Reference, Up: Utilities Reference   [Contents][Index]