Apologies for this being a little long-winded. It's my MO to always try and be as thorough as possible.
If you've already successfully logged compiled scripts then we're part way there.
The script needs a log file set, and that's something you're already familiar with.
A logfile will still be generated if we set _write_log_file to zero - it just won't log subsequent lines unless we set it to 1 again.
If I compile the following script (and make sure to specify the logfile) :
Code: Select all
// COMPILE_OPTS|D:\mondaylogINI.exe||CONSOLE=0|INCLUDES=1|/LOGFILE=D:\mondaylogINI.log|RUNTIMES=0|BMPS=1
let>_write_log_file=0
let>this=that
let>cat=dog
let>_write_log_file=1
let>bee=bird
let>water=wine
let>_write_log_file=0
let>day=night
let>dark=light
... the resulting logfile shows the lines after let>_write_log_file=0 are not logged :
Code: Select all
31/07/2023 09:19:30:406 - Started Macro : D:\mondaylog1.exe
31/07/2023 09:19:30:416 - START: 1: // COMPILE_OPTS|D:\mondaylog1.exe||CONSOLE=0|INCLUDES=1|/LOGFILE=D:\mondaylog1.log|RUNTIMES=0|BMPS=1
31/07/2023 09:19:30:426 - END: 1: // COMPILE_OPTS|D:\mondaylog1.exe||CONSOLE=0|INCLUDES=1|/LOGFILE=D:\mondaylog1.log|RUNTIMES=0|BMPS=1
31/07/2023 09:19:30:436 - START: 2: let>_write_log_file=0
31/07/2023 09:19:30:446 - END: 5: let>_write_log_file=1
31/07/2023 09:19:30:456 - START: 6: let>bee=bird
31/07/2023 09:19:30:466 - END: 6: let>bee=bird
31/07/2023 09:19:30:476 - START: 7: let>water=wine
31/07/2023 09:19:30:486 - END: 7: let>water=wine
31/07/2023 09:19:30:496 - START: 8: let>_write_log_file=0
31/07/2023 09:19:30:506 - Finished Macro : D:\mondaylog1.exe
Even if let>_write_log_file=0 was the first line of code, we'd still end up with a logfile which would look like this :
Code: Select all
31/07/2023 09:19:30:406 - Started Macro : D:\mondaylog1.exe
31/07/2023 09:19:30:416 - START: 1: // COMPILE_OPTS|D:\mondaylog1.exe||CONSOLE=0|INCLUDES=1|/LOGFILE=D:\mondaylog1.log|RUNTIMES=0|BMPS=1
31/07/2023 09:19:30:426 - END: 1: // COMPILE_OPTS|D:\mondaylog1.exe||CONSOLE=0|INCLUDES=1|/LOGFILE=D:\mondaylog1.log|RUNTIMES=0|BMPS=1
31/07/2023 09:19:30:436 - START: 2: let>_write_log_file=0
31/07/2023 09:19:30:506 - Finished Macro : D:\mondaylog1.exe
So the logfile would still be generated.
With the above clarified, we can use an ini file to turn off logging from within the script :
My False ini file :
My script :
Code: Select all
// COMPILE_OPTS|D:\mondaylogINI.exe||CONSOLE=0|INCLUDES=1|/LOGFILE=D:\mondaylogINI.log|RUNTIMES=0|BMPS=1
ReadIniFile>d:\myini.ini,settings,logging,writelogfile
If>writelogfile=False
let>_write_log_file=0
Endif
let>this=that
let>cat=dog
let>bee=bird
let>water=wine
let>day=night
let>dark=light
The logfile :
Code: Select all
31/07/2023 09:30:39:977 - Started Macro : D:\mondaylogINI.exe
31/07/2023 09:30:39:987 - START: 1: // COMPILE_OPTS|D:\mondaylogINI.exe||CONSOLE=0|INCLUDES=1|/LOGFILE=D:\mondaylogINI.log|RUNTIMES=0|BMPS=1
31/07/2023 09:30:39:997 - END: 1: // COMPILE_OPTS|D:\mondaylogINI.exe||CONSOLE=0|INCLUDES=1|/LOGFILE=D:\mondaylogINI.log|RUNTIMES=0|BMPS=1
31/07/2023 09:30:40:027 - START: 14: ReadIniFile>d:\myini.ini,settings,logging,writelogfile
31/07/2023 09:30:40:037 - END: 14: ReadIniFile>d:\myini.ini,settings,logging,writelogfile
31/07/2023 09:30:40:037 - START: 15: If>writelogfile=False
31/07/2023 09:30:40:047 - END: 15: If>writelogfile=False
31/07/2023 09:30:40:057 - START: 16: let>_write_log_file=0
31/07/2023 09:30:40:067 - Finished Macro : D:\mondaylogINI.exe
My true ini file :
Using the same script.
Code: Select all
31/07/2023 09:30:07:882 - Started Macro : D:\mondaylogINI.exe
31/07/2023 09:30:07:892 - START: 1: // COMPILE_OPTS|D:\mondaylogINI.exe||CONSOLE=0|INCLUDES=1|/LOGFILE=D:\mondaylogINI.log|RUNTIMES=0|BMPS=1
31/07/2023 09:30:07:892 - END: 1: // COMPILE_OPTS|D:\mondaylogINI.exe||CONSOLE=0|INCLUDES=1|/LOGFILE=D:\mondaylogINI.log|RUNTIMES=0|BMPS=1
31/07/2023 09:30:07:922 - START: 14: ReadIniFile>d:\myini.ini,settings,logging,writelogfile
31/07/2023 09:30:07:932 - END: 14: ReadIniFile>d:\myini.ini,settings,logging,writelogfile
31/07/2023 09:30:07:942 - START: 15: If>writelogfile=False
31/07/2023 09:30:07:952 - END: 15: If>writelogfile=False
31/07/2023 09:30:07:962 - START: 19: let>this=that
31/07/2023 09:30:07:972 - END: 19: let>this=that
31/07/2023 09:30:07:972 - START: 20: let>cat=dog
31/07/2023 09:30:07:982 - END: 20: let>cat=dog
31/07/2023 09:30:07:992 - START: 21: let>bee=bird
31/07/2023 09:30:08:002 - END: 21: let>bee=bird
31/07/2023 09:30:08:012 - START: 22: let>water=wine
31/07/2023 09:30:08:022 - END: 22: let>water=wine
31/07/2023 09:30:08:032 - START: 23: let>day=night
31/07/2023 09:30:08:042 - END: 23: let>day=night
31/07/2023 09:30:08:052 - START: 24: let>dark=light
31/07/2023 09:30:08:062 - END: 24: let>dark=light
31/07/2023 09:30:08:082 - START: 37:
31/07/2023 09:30:08:092 - END: 37:
31/07/2023 09:30:08:102 - Finished Macro : D:\mondaylogINI.exe