This page is intended to help log operations. It compromises a quick tutorial in message logging and logging playback. It also explains how new message types can be added to the recorder.
Any IPC message that is transmitted using the publish subscribe method can be logged using the Recorder module. When logging, messages received by the logger module are stored in files. The module that plays messages reads them from the disk files and publish them.
There are now two distinct message formats supported, v1.x and v2.x.
In logs v1.xtwo files are used, one file contains the header of messages (header_file) and the other the actual data (data_file). The header_file contains information about which messages were logged, their size, position in the data_file and timestamp. This information is used by the module playing the messages to read the messages from the file, unmarshing them to a message structure and publish them. The logging module must marshall the message received and output it to the data file.
Log format v2.x is a new format of logs developed to allow easy expansion of log functionalities and a more clear data representation. So log header files are now written in XML format. In this format logs compromise one header_file and one or more data_files. The header_file contains log information such as log session information, sensor list, message types and also message listing.
The message listing field contains message id, start position, length and timestamp in a similar fashion to log v1.x. To get a more compressive listing of all possible fields check the logs in lar/data/logs, additional fields can be added to any section of the file as long as the message listing current field are not removed or tampered. In this format several data_files are used, each message type possesses a different data_file, this is a simple log fragmentation that help with log manipulation. Each data_file is named as logname_messagename_X.xml.
central
cd ~/lar/src
param_deamon ini/INIFILE
cd ~/lar/src/sensors/camera/firei
./firei_publish -camera 0
cd ~/lar/src/logging/recorder
./logger [-savelog LOGNAME] or ./recorder [LOGNAME]
central
cd ~/lar/src
param_deamon ini/INIFILE
cd ~/lar/src/logging/player
./playback LOGPATH or ./player_v1.x LOGPATH or ./player LOGPATH
playback_control
cd ~/lar/src/sensors/camera/firei
./firei_subscribeexample
There are two log recorder programs. The logger and the recorder. The logger program creates v1.x logs while the recorder creates v2.x logs.
There are tree log player modules, the playback, the player_v1.x and the player.
The playback module works with v1.x logs as well as the player_v1.x.
The player module works with v2.x logs.
When logging in v1.x format the following message types are supported.
The message types suported in v2.x logs are defined in the lar/src/logging/recorder/messages.xml file.
Send a email to jalmeida@ua.pt and pray for the best.
Add the message name and format of the new message to the lar/src/logging/recorder/messages.xml file.
Make sure that the message structure is in the supported format (see messages.xml for instructions).
If it is not the recorder module will have a segmentation fault Add a variable to the inifile in the format: recorder_MESSAGENAME ON/OFF.
If you don't add the variable to the inifile the messages received will not be logged.