2005/5/9

     
 

CfgScript Logging

artefaktur

| Syntax Elements | Source | Preprocessor | Types | Expressions | Backtick Expressions | Statements | Class | Logging |

CfgScript has a build in logging functionality, which is based on the acdk::util::logging framework.

You can use the ACDK_LOG() for unnamed or root logging or ACDK_NLOG() for named logging. Sample:

ACDK_LOG(Trace, "Hello");
ACDK_NLOG("my.scope", Info, "This is the current environment: " + __props.toString());
The reason to make logging a part of the language is simply performance. The interpreter checks after parsing ACDK_NLOG("my.scope", Info, if the there is a logger in the given loglevel. If There is no logger, the interpreter simple skip the rest of the statement. For more information about the ACDK Logging please refer to  ACDK Logging framework.