log_init_from_context

The log_init_from_context method initializes the RAPLogging from an existing context created by a previous call to log_open().

This can be used to pass a logger instance to a shared library function. This function must be called before any other API in the RAPLogging API is invoked in the shared library.

The following sequence of calls should be used 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

logger_context * ctx

The logger_context pointer to be used to initialize the RAPLogging in a shared library.

Returns

uint16_t error_code (an error code) or ERR_NONE (value 0).


Created March 26, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com