BRSE_ARL

Intro

This library writes to the built-in AS logbook using a set of asynchronous function calls. The function syntax is similar to the ANSI-C function “printf”, as can be seen in the examples.

The asynchronous behavior is achieved by putting all incoming messages into a local FIFO buffer. This buffer stores the log messages until they are fetched by calling BRSE_ARL_Cyclic() and written to the actual AS logbook using the built-in AS function “AsArLogWrite”. Therefore, the synchronous nature of the “AsArLog” library is completely hidden to the user.

By choosing a unique ID, a specific logbook can be addressed.

Overview

Description

Start by setting up and creating the logger with the BRSE_ARL_Alloc() function. The name of the logger can be set or, if a name is not given, the default user logbook will be used. Add BRSE_ARL_Alloc() to the init code.

Next, cyclicly call the function BRSE_ARL_Cyclic() so that the FIFO buffer can “empty” its write-commands to the logbook.

Now any message type can be sent to the logbook by using BRSE_ARL_Fatal(), BRSE_ARL_Warning(), or BRSE_ARL_Info().

When finished with the logbook, use the BRSE_ARL_Free() function to empty and close the FIFO buffer. Place BRSE_ARL_Free() in the exit part the code.

This is an example of logbook output taken from AS. Custom error IDs should be > 50000, lower IDs are reserved for AS.

Use Cases

This is a low level interface and, in most cases, should only be used inside another library or wrapper function. For a prebuilt wrapper, see Loupe’s LogThat library.

Overview