It is handy to use logging because Logic Test Drive does not behave exactly the same way as when the logic runs in a "real" environment. Then the LOG file helps you find out what is going on.
Table of Contents | ||
---|---|---|
|
Logging from Groovy
Code Block | ||
---|---|---|
| ||
api.logInfo("Target Date", api.targetDate()) api.logWarn("A bigger problem", "something important") |
...
Code Block | ||
---|---|---|
| ||
api.trace("competitorName", null, competitorName) api.trace("competitorName", "", competitorName) api.trace("Current month - Last month", currentMonth, lastMonth) |
When you run the calculation logic using the Test Logic (Debugger), then you get:
...
Printing Information about Data Object
Groovy defines additional functions on objects:
dump()
inspect()
Both can be used to format nicely (and then display) what is in the object.
...
To see the log file for your partition:
Go to Admin > View Logs.
A new window with a "live" log opens, with the latest log record at the top. It reloads automatically every couple of seconds.
Setting up Logging
If a record does not show up in the log file, verify the following:
...
Allow Groovy logging in General Settings in Configuration.
...
Settings on this page do not apply immediately. Because of caching it can take up to 5 minutes.
Ensure that your partition has the logging level set for SandboxAPI.
Log in as the root.
Go to System Admin > View Logs > Log Levels.
Filter for "Sandbox" and check the level setting.
...
If the logging still does not work, restart the pricefx-server.