Adding a log server and output channels to a solution

The LogrrServer program sends messages to one or more output channels. You can write log messages to files by using the output channel named FsOutputChannel.

Adding and configuring logging server

The command for creating and configuring the log server create_logrr_server() may contain the following parameters:

To add the LogrrServer program to a solution:

Edit the root file containing the CMake commands for building the solution or the file containing the CMake commands for building the Einit initializing program:

CMakeLists.txt

find_package (logrr_server REQUIRED COMPONENTS ENTITY)

# ...

set (TASKS

# ...

${logrr_server_ENTITY})

# ...

# Add the server that uses the output channel FsOutputChannel

create_logrr_server(

LOG_LEVEL DEBUG

WRITE_TO_CORE ON

OUTPUT_CHANNELS

logrr.FsOutputChannel)

# Adding a server and output channel to a solution

list(APPEND ENTITIES

logrr_server::default_entity

logrr_fs_output_channel::default_entity)

# Create static IPC channels for source programs to connect to the server

connect_to_logrr_server (ENTITIES ClientOne)

build_kos_qemu_image (kos-qemu-image

CONNECTIONS_CFG ${INIT_YAML_FILE}

SECURITY_PSL ${SECURITY_PSL_FILE}

PACK_DEPS ON

${TASKS})

The PACK_DEPS option must be included when calling the build_kos_qemu_image() or build_kos_hw_image() command to include an automatic build of the libraries in the disk image.

Adding and configuring output channels

The command for creating and configuring the channel for printing logs to files create_logrr_fs_output_channel() may contain the following parameters:

To add the FsOutputChannel to a solution:

Edit the root file containing the CMake commands for building the solution or the file containing the CMake commands for building the Einit initializing program:

CMakeLists.txt

find_package (logrr_fs_output_channel REQUIRED COMPONENTS ENTITY)

# Add the FsOutputChannel that writes to the file

create_logrr_fs_output_channel (

APP_LOG_DIR "/log/apps"

SYS_LOG_DIR "/log/sys")

Creating IPC channels and allowing interaction between programs

The build system automatically creates IPC channels required for the log system to work, and generates a security policy description that allows interaction between processes.

To create a static connection to the log server, you can use the CMake command connect_to_logrr_server (ENTITIES <names_of_programs_to_connect>).

Page top