DirWiz Logo
Knowledgebase

Article Tags

Debug logging in custom eval.js functions

2020-10-30 11:46:20
Custom Mapping Javascript Troubleshooting UnitySync 

As of v3.1, there is a new feature to assist with debugging custom eval.js functions.

Here’s the enhancement description.

  1. The function is built in (doesn’t need to appear in eval.js).

  2. The syntax is: uslog('Text to output',#)
    (Where # is the log level you want it to write to.)

  3. If using ONLY uslog, can be assigned to bogus attribute.
    Check1=&uslog('Test Debug Logging',2)& (Plain text)
    Check2=&uslog('LastName is: ^sn^',2)& (Text AND attrib value)

  4. Or it can be used with valid attribute assignment:
    Department=ABC &uslog('Logging Text AND set Dept to ABC',2)&
    (This is just a convenient way of adding it to a specific attribute mapping. The logging doesn’t appear in the attribute, just the console and logs).

  5. The output of all three of the above mappings appear in your custom map file.
    Javascript Debug | Test Debug Logging
    Javascript Debug | LastName is: Randal
    Javascript Debug | Logging Text AND set Dept to ABC
    Mod Object | cn=paul@phila.com,ou=v28,ou=ROOT_ENV,dc=2k19,dc=test

  6. Debug text appears in Console and logs.

Share this article: Twitter reddit