Not sure what you mean by that last comment . . but I'll take the thank you :-) and explain what I do . . .
I have an extern and some bools . . .
in init() I do this . . .
then I use this to control which Print statements get executed . . .
If I set Debug_Level=0 then I get no debugging messages and very small log files . . . I still have the option to Print important messages that I want regardless . . . I just don't use the if (Dx)
I stumbled across this but was thinking about how I might tun off my debugs without using // all the time ...
That's a very smart way to set up the debug, thanks :-)
You have to use If statement, something like :
extern int debugmode = 1; // 0 = off, 1 = on
if (debugmode == 1)
And if you want to make it more complex, I use a custom function debug(string msg, int level), which outputs messages to a separated debug file. The file is rewritten every time a new debug starts.
The debug output and its level are controlled by a public variable, which enables anybody (even a customer without a source code) to switch it on and off and send me the debug file.
Also (hoping thread is not too old!),, I have my EA reduce the logging level after a number of days (modelled) ...,
So for the start date and a few days after, full logging, then it falls away to just important messages.
If I see bad exit/entry in the the job history, then I re-test against that day, and get full logging again...
Create a script to delete MT4 / MT5 log files (builds 670 and 965 respectively current)
See here # post 5