Log Messages in DocBridge Mill Profiles

DocBrige Mill processing can be controlled by means of a configuration file – an XML, human readable profile. The processing logic is determined by using JavaScript commands. This includes the generation of user defined log messages. At runtime JavaScript may produce messages, for example to give a processing status report or to note the intermediate value of a variable. Messages can be produced at different levels, the use of which is described in this article.

The "print" command is provided for short reporting transient control messages. Text output is directed exclusively to the console.

Example: print("The application started successfully");

The "log" command also prints a message on the console, but in addition makes an entry in the log file.

Example: log("The number of documents is:" + cDocs);

Finally the command "logMsg" has the same effect as the "log" command, output to the console and an entry in the log file. Two attributes make it seem more useful than the "log" command. Firstly an additional parameter can be used to add a message ID. A message then becomes consistent with messages produced by the system. Apart from this, the message ID contains also a message class - in the example "I" can indicate "Information".

Example: logMsg("JSC4003I Searching for text ' " + searchText + " ' ");

With the appropriate filter, message classes can be activated or de-activated.

Example: setLogIgnoreLevels("V");

With the appropriate filter, message classes can be activated or de-activated. Example: setLogIgnoreLevels("V");

This turns off message classes, in this example "V" stands for "Verbose". This approach means that in early phases of a project any level of detail can be included in the scripts. Once a project goes into production, messages no longer required can be inhibited from printing without having to delete them.

Back