39. Environment variables

Values within [] is the default value.

Table 39.1 Environment variables controlling logging behavior

Environment variable

Description

AGX_LOG_OVERWRITE = [0]/1

Specify whether the log file will be overwritten, or if new files should be generated as AGX_LOG_FILE.0001 .0002, …

AGX_LOG_ENABLE=1/[0]

Specify whether the messages will be logged to a file or not.

AGX_LOG_LEVEL =0/[1]/2/3

Specify the level for which messages will be logged to file.

AGX_LOG_FILE= agx.log

Specify the path to the log file that should be generated.

AGX_OUTPUT_LEVEL=0/[1]/2/3

Specify the level for which messages will be logged to the console.

AGX_THROW_ON_ERROR=[1]/0

Should an exception be thrown when an error message is written?

AGX_BREAK_ON_ERROR=[0]/1

Should a breakpoint be set when an error message is written? This only works in DEBUG build in VisualStudio.

Table 39.2 Other environment variables

Environment variable

Description

AGX_FILE_PATH

Specifying where resource files will be found (models, images, scripts…)

AGX_PLUGIN_PATH

Specifying where plugins can be found.

AGX_PROCESS_PRIORITY=[2]/0..4

0 is lowest, 4 is real time priority. 2 is default priority. Works in Win32 only

AGX_PROCESS_AFFINITY=[0]/1

Specify whether the main thread for agxSDK::Simulation will be restricted to run on the current executional unit, or if it is allowed to be scheduled by the OS. Works in Win32 only

AGX_STATISTICS_ENABLE=[0]/1

Enable writing statistics information to a file specified with AGX_STATISTICS_PATH

AGX_STATISTICS_PATH=<filepath>

Specifies the file to which the statistics information will be written if enabled.

AGX_STATISTICS_INTERVAL=<float>

Specifies how often statistics information will be written to file in seconds. 1==write once every second.

AGX contains a mechanism for logging messages to file and/or console which is implemented through two classes, agx::Logger and agx::Notify. There are four different levels of messages:

Table 39.3 Values for Notify level

Value

Meaning

Description

0

Debug

Use for low level debug/test messages, seldom displayed

1

Info

Use for information of loading files, finding data, etc, shown by default

2

Warning

For warnings that occur.

3

Error

For fatal errors. Error can also throw std::runtime_exception() if it is enabled.