Set error and warning handlers: Raptor RDF Syntax Library Manual

## Set error and warning handlers

Any time before serializing is started, a log handler can be set on the world object via the `raptor_world_set_log_handler()` method to report errors and warnings from parsing. The method takes a user data argument plus a handler callback of type raptor_log_handler with a signature that looks like this:

    void
    message_handler(void *user_data, raptor_log_message* message)
    {
      /* do something with the message */
    }

The handler gets the user data pointer as well as a raptor_log_handler pointer that includes associated location information, such as the log level, raptor_locator, and the log message itself. The locator structure contains full information on the details of where in the file or URI the message occurred.