This is a handy function for setting the log level dynamically in a running console. I think the original inspiration for this came from Rob Duda – thanks Rob!
Often you want to see more information, or less noise, in your running console during local development. This function is a great way to get there without having to restart your server. We will likely include this in our core libraries in a future release. For the time being, you can simply include it in your scratchpads or create a library (e.g. ed.scm in Resources/Libraries) of helpful functions like this one in your project. You can even load your “personal” library functions by putting something like
"(load \"<script_location>")" - in the program arguments of your scheme console settings at Window/Prefrences/NexJ Studio/Launch Settings/Scheme Console Settings/Server Console/Program Arguments
e.g. “(load \”c:/work/utils/ed.scm\”) – [I beleive the hyphen is needed to force the load]
Here is the function definition.
; Set the log level in a running console
; @arg level integer Log level from 0 (warn) to 3 (all)
; @ret any
(define (setLogLevel level)
To use it just run
(setLogLevel 2) ; this will turn on debug level logging