Download MetaTrader 5
To add comments, please log in or register
How to buy a product in MetaTrader AppStore? Read the article!
dasser
69
dasser 2013.03.24 11:45  
RaptorUK:

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 :-)

Dasser

Alain Verleyen
Moderator
29606
Alain Verleyen 2013.03.24 12:13  
dasser:

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 :-)

Dasser


You have to use If statement, something like :

extern int debugmode = 1;    // 0 = off, 1 = on


if (debugmode == 1) 
   Print("blablabla...");
and set debugmode to 0 when you don't need to print.
Ovo Cz
2988
Ovo Cz 2013.03.24 17:20  

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.

ydrol
593
ydrol 2013.08.09 13:49  

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...

file45
157
file45 2014.08.12 23:12  

Create a script to delete MT4 / MT5 log files (builds 670 and 965 respectively current)

See here # post 5 

/ /12
To add comments, please log in or register