Debug logging in custom eval.js functions

Created: 2020-10-30 11:26:47
Modified: 2021-02-16 09:18:03
Tags: Custom Mapping Javascript Troubleshooting UnitySync

As of v4, 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:
Knowledgebase

Directory
  1. Directify - Self Service

  2. Mimic - Replication

  3. UnitySync - Sync
Password
  1. emPass - Sync
Obsolete
  1. Profiler
  2. SimpleSync