Rss Categories

Grammar Logging Callback Function

Reference Number: AA-01048 Views: 3024 0 Rating/ Voters

The callback function is called by the LVGrammar interface when an error or warning is generated during the processing of a grammar.

  • typedef void (*GrammarLogCB)(const char* message, int error_level, void* user_data)



The types of errors which can be passed through the callback via the error_level parameter are:

  • LV_GRAMMAR_LOADING_ERROR -- the grammar could not be loaded from the location provided.
  • LV_GRAMMAR_SYNTAX_ERROR -- one or more rules or statements in the grammar was badly formed.
  • LV_GRAMMAR_SYNTAX_WARNING -- one or more statements in the grammar were either missing, or not strictly conforming to specifications, but the grammar handler was able to recover.


Provides more detailed information concerning error_level.


A pointer to a user-defined class or function which can customize behaviour when the LVGrammar interface sends logging messages through the callback.

See Also