Class Information:
| ClassPath: | MEng.System.CQC.Runtime.CQCLogger |
| Parent ClassPath: | MEng.Object |
| Copyable: | No |
| Final: | Yes |
MEng.System.CQC.Runtime.CQCLogger provides a mechanism by which CQC macros and drivers can log messages to the central log server on the CQC Master Server.
This is a class you must use carefully. On the one hand, logging useful information can massively improve the ability to diagnose problems in the field. However, because of the periodic, and often rather rapid periodic, nature of the device driver callbacks or looping flow control mechanisms, if you get into a situation where you are logging something every time around a loop or on every callback, you will quickly fill up the log files, and push out any useful information. Get caught in a loop somehow, logging each time through, and you'll bring the whole system to it's knees.
So use this class where appropriate, but be very careful about it's use. If necessary, use a Boolean class member as a flag to insure that you only log something once, or only log when it transitions into the questionable state, not as long as it is in that state.
Constructors:
Constructor();
There is just a default constructor available.
Final, Non-Const Methods:
LogMsg([In] MEng.String ToLog);
LogMsg1([In] MEng.String ToLog, [In] MEng.Formattable Token1);
LogMsg2
(
[In] MEng.String ToLog
, [In] MEng.Formattable Token1
, [In] MEng.Formattable Token2
);
LogMsg3
(
[In] MEng.String ToLog
, [In] MEng.Formattable Token1
, [In] MEng.Formattable Token2
, [In] MEng.Formattable Token3
);These methods allows CML classes to log text messages to the centralized log server. There are a few variations that also allow you to provide replacement tokens that are formatted to text and used to replace numbered replacement tokens in the log message text. This is built on the standard token replacement functionality in the String class, so see it for more details on the token options. You can pass any object that derives from Formattable, which means that it can be formatted to an output stream, so this is very flexible. Token1 replaces %(1), Token2 replaces %(2), and Token3 replaces %(3). The positions of the tokens in the log message are not important, only their token numbers.