Figuring out the log mode
Posted: Sat Apr 02, 2016 6:34 pm
Hello,
Is there a way to get the current logmode in a string variable? When I write helper programs to exec into larger projects, I like to write them in a way that leaves the workfile as they found it, and I also like to allow myself the option to pass in the program option "quiet" to suppress log messages. For example:
I'm currently just assuming logmode was set to logmsg before the program was exec'd and just resetting to logmsg before exiting. For completeness, I'd like to be able to do something like:
Thoughts?
Thanks,
-James
Is there a way to get the current logmode in a string variable? When I write helper programs to exec into larger projects, I like to write them in a way that leaves the workfile as they found it, and I also like to allow myself the option to pass in the program option "quiet" to suppress log messages. For example:
Code: Select all
'--- Environment ---'
%original_sample = @pagesmpl
'--- Potentially change logmode ---'
if @hasoption("quiet") then
logmode -logmsg
endif
'--- Some useful thing or set of things that the program does ---'
stuff stuff stuff
'--- Clean up before returning to the calling program ---'
smpl {%original_sample}
Code: Select all
%logmode = @logmode
...
'--- Clean up before returning to the calling program ---'
logmode {%logmode}
Thanks,
-James