![]() |
Logging and DebuggingLogging and debugging is done through the Task object. A logfile will show up in your Metamerge install directory in the logs subdirectory: Each run will create a new logfile bearing the name of your assemblylines and a run number. Key data is logged from the Metamerge Integrator engine, from its components (connectors, parsers, etc.) as well as from user's scripts. Note that almost every connectors has a parameter called "Debug Mode" - with this parameter the user can turn on and off connector's output into the log file.
Metamerge Intergrator provides its users with the following "logging/debugging" functionality to use by scripting. Dumping to the log file is done through the task object. Dumping to the console is done through the main object. What is provided below is an outline what the user can dump and sample code in JavaScript that performs these operations. All examples show how to dump in the log file. However all you have to do in order to dump to the debugging console is to change the task keyword to main . 1. Dumping the content of an Entry object. task.dumpEntry(entry) / "main.dump(entry)" will dump the entry to the debugging console /
2. Dumping the content of an Attribute: 2.1. Dumping single value Attribute: Suppose attr (with name Attr1) is the single value attribute you wish to dump. You can create your own attribute and set a value to it with the following 2 lines of code: var attr =
system.newAttribute("Attr1"); - the dumping
itself: 2.1. Dumping multiple values Attribute: Suppose attr (with name Attr1) is multiple values attribute you wish to dump. You can create your own attribute and set some values to it with the following 3 lines of code: var attr =
system.newAttribute("Attr1"); - the dumping
itself:
3. Dumping the state of a Connector: You can dump (any time) the state of any of the connectors involved in your integration process. The sample code bellow gives you (dumps) all the information available for a particular connector - suppose its name is Conn. Of course, according your needs you can dump arbitrary subset of the connector's parameters listed below. var status =
Conn.getStats(); 4. Dumping arbitrary log messages: We won't surprise you telling you that with the logmsg function you can log any text you want. This means you can indicate (to the log file or to the debugging console) any state of the custom logic of your assembly lines. task.logmsg("Type here the message you want to dump");
|
|