log_init_from_context

Initializes the RAPLogging API from an existing context created by a previous call to log_open().

Use log_init_from_context to pass a logger instance to a shared library function. Call this function before any other API in the RAPLogging API is invoked in the shared library.

Use this sequence of calls in your main executable to pass a logger instance to a shared library:

  • Initialize the logger as usual by invoking log_open().

  • Get the pointer to the logger_context by invoking log_get_context().

  • Invoke your shared library function by passing it the logger_context pointer.

In your shared library function:

  • Invoke log_init_from_context() by passing it the logger_context pointer as the argument.

  • Invoke the log_message() function to log messages from your shared library.

Syntax

uint16_t log_init_from_context( logger_context * ctx  );

Parameters

Returns

uint16_t error_code

An error code or ERR_NONE (value 0).