02-22-2018 08:24 AM
I know OnBase 17 (maybe 16?) introduces a nifty feature where a developer can toggle logging levels for individual Unity Scripts in the OnBase Studio GUI.
Most of our existing dozens of Unity Scripts use libraries that look at a Unity Configuration Item and set the Diagnostics Level accordingly, making it easy to ramp up or down logging for a whole solution set of scripts. It is definitely less granular than the new per-script toggling option.
In the long run we might simplify and rely on the built-in feature, we might make our libraries smarter, we might use the new feature for new solutions but not retrofit older ones, anything is on the table. But in the short run, we just need to know what is the minimum amount of work that will let us know what logging we're going to get and how to adjust it, as part of upgrading from OnBase 15 to OnBase 17.
Can anyone point me to one place that would summarize how the new feature works and how it would interact with the traditional way of setting the level programmatically?
-SDK? (hint: the section "Diagnostics Logging For Unity Scripts" is another new feature I'm glad to know about, but it isn't this)
-MRG? (the Studio MRG tells me about the dialog box for setting a default level, but it doesn't tell me how the setting actually works)
-API Blog post with more detail?
-Anyone's personal experience?
Thanks for any information anyone has to share!
03-07-2018 09:57 AM
Any changes made within the script to diagnostics level will override the GUI setting. I highly recommend using the GUI setting when possible as it removes the need to manage configuration items or to rebuild scripts that are hard-coded with diagnostics levels.
Bryan Sorensen
API Analyst| OCAPI - OCI
API Support Team
02-22-2018 08:40 AM
Alex,
The new feature came out in V16. It is documented in the SDK under app.Diagnostics.WriteIf.
There is an object/property called "Level" that can be set in script like with the following:
app.Diagnostics.Level = Diagnostics.DiagnosticsLevel.Verbose
The first parameter of the WriteIf is the "level" under which the entry will be written to the console:
app.Diagnostics.WriteIf(Diagnostics.DiagnosticsLevel.Verbose,"This event would be written if the app.Diagnostics.Level was set to verbose, but not under.")
02-22-2018 10:54 AM
02-22-2018 08:43 AM
What information are you looking for? I am happy to discuss my experiences with it.
In short: Each script has a setting for the diagnostics level. This setting determines the initial value of app.Diagnostics.Level. You can still reference that property to see what is set, and you can even change it mid-script if you want. (For example, if you keep using your current library that sets the level, that will override the initial script-level setting.)
You can think of this setting as an implicit line of code at the start of your main method that says:
app.Diagnostics.Level = XXX;
Everything after that works the same.
[Edited to correct the name of the "Level" property.]
02-22-2018 10:58 AM
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.