Using Logger Commands on the Command Line

When you start the Logger, you can use the -r command-line option to specify Logger commands. Commands must be surrounded by double quotes. To use double quotes within a command, protect them with a backslash escape character (). Strings in string lists are separated by spaces. Strings cannot contain spaces.

Note: Commands that are specified using -r are executed after the Logger connects to the exercise. Therefore, commands that need to executed at connection time, such as SetConnectionParameters, do not work from the command line.

The following example starts the Logger and opens the file ..\logger_tapes\berkeleyDemoHLA13.lgr. Note the use of the backslash to protect the quoted string within the command.

logger -r "OpenFile \"..\logger_tapes\berkeleyDemoHLA13.lgr\""

Note: The OpenFile command is unique. If you simply specify a Logger file on the command line, the Logger assumes -r OpenFile and opens the file, for example:

logger "../logger_tapes/berkeleyDemoHLA13.lgr"

The following example enables time management and specifies a subscription list:

logger -n 3 --federateName logger
   -r "SetTimeManagement true true true true 0.1"
   -r "SetSubscriptionLists \"ObjectRoot.BaseEntity.PhysicalEntity.Platform.Aircraft ObjectRoot.BaseEntity.PhysicalEntity.Radio\" \"InteractionRoot.WeaponFire\""