Logging Interface

Interface to receive log messages from the Epic Online Services SDK

2 mins to read

The Logging Interface gives developers access to useful output from the Epic Online Services (EOS) SDK that can help to diagnose technical issues both during development and after shipping a product. Unlike other interfaces in the EOS SDK, the Logging Interface does not communicate with remote machines, and does not require a handle.

Receiving Log Data

To receive log output from the EOS SDK, you must first initialize the EOS SDK (See the Platform Interface documentation for more information). Then, register a callback function (of type EOS_LogMessageFunc) by passing it to the EOS_Logging_SetCallback function. Whenever another Interface produces log output, your function will receive an EOS_LogMessage data structure containing the relevant data. EOS manages the memory for this data, and can delete it at any time following the end of the callback function, so you must make your own copy of any information you want to keep past the callback function's lifetime.

Filtering Log Data

The Logging Interface features a built-in filtering system that can help you focus quickly and easily on the information you need. All logs generated by EOS have a category that indicates which subsystem or interface created them, and a "verbosity" level indicating the log's overall importance. You can filter messages from any category, or all categories, such that only those at or below a given verbosity level will trigger your callback function. To do this, call EOS_Logging_SetLogLevel with the category (using EOS_ELogCategory) and the verbosity level (using EOS_ELogLevel). You can also set the level for all categories at once, and can filter one or more categories out entirely. The following code snippet shows a few examples:

By default, all categories report all log data to the callback function.