![]() |
GeMA
The GeMA main application
|
When the GeMA simulator is initialized, its first action is to read the configuration file. Unless explicitly provided by the -c
command line parameter, it looks for the file named defaultConfig.lua
on the config
directory on the same path as the GeMA executable.
Some of the options controled by this file are:
The configuation file can also be used to define default values for global simulation options and constants. This values can be overwritten by the simulation object.
For replacing a subset of the config options, instead of editing the global file, a better option is to create a user file that loads the basic default configration by calling dofile("$APP/config/defaultConfig.lua")
and only replaces the needed configuration options. Then, when running GeMA, pass this new user config file with the -c
option. The batch file used to run regression tests uses this strategy to load a personalized configuration file.
Some of the configuration options are file paths. For extra flexibility, those values can be created with the help of path macros that are expanded by GeMA.
The available configuration options are well explained in the default configuration file itself. Please refer to the actual file for an explanation of each option.
In GeMA, all messages that get sent to the console and/or to the log file are created by logger objects. The logLevels
table, located on the configuration file, can be used to control exactly which messages will be printed and wich will not.
Every message has a tag that identifies the logger that originated that message, together with its classification level. Logger names are GeMA component names, such as "gema.modelInfo", the logger that prints model information, or "gema.simRunner", the logger responsible for global messages while running the simulation. The classification level for each messge is a label such as "error", "warning" or "info". A message tag is given by composing the component name with the classification label, like in "gema.simRunner.info". Refer to the configuration file for the complete list of logger names.
Available classification levels are:
To learn the tag associated with every log message, just set logShowLoggerName = true
in the configuration file and run a simulation. Each message will be prefixed with its tag.
The logLevels
table defines which messages are enabled or disabled, and might look like:
Each table line enables or disables the messages identified by a message tag, where the logger name or the classification level can be replaced by an *
meaning all loggers or all classes. Rules are processed in order. If a later rule overlaps with a previous one, the later will prevail, which combined with *
makes it easy to create general policies with exceptions. On the previous example, the first rule disables every time message, but the third rule explicitly enables time messages from the "gema.sim" logger, which means that only that logger will be able to show time messages.
When creating a customized logLevels
table, keep in mind that the given set of rules is always processed after the following basic rules: