Print statments or 'Alerts' for Debuging - page 2

 
gordon:

It's a bit of overkill to install cygwin just for tailing and pointless for anybody who is not familiar with linux/unix os's... But yeah, that would work to. I wonder why MQ didn't make log files (both experts and journal logs) flush on each write. It would make the log files so much more usable.

I don't use, nor have I ever used Unix/Linix etc.

Can anyone suggest an alternative for: Windows XP, Vista and Win7 ? Preferably one program that wil work with al of the 3 versions of Windows?

Thanks again.

 

Couple of options spring to mind:

- Baretail

- a "tail" command addition for the Windows command prompt - get it by downloading the Windows 2003 Resource Kit


CB

 
Again I would recommend a freeware called baretail. I have checked over 15 tail programs for windows until I landed on this one. It's the only tail program I have seen that can open ANY sized file within <1sec while keeping a constant fixed and small memory print. The freeware version has gota nag screen but otherwise is fully functional. http://www.baremetalsoft.com/baretail/
 

It's similar to a text editor for text files (such as the mt4 log file) with 2 main differences:

- you can't edit the text, just view it

- the program 'tails' the file in real time, that means u always see the last lines of the file in real time


This is NOT very useful for the built in MT4 logs (experts and journal logs) since they are not flushed on each write. They are only flushed occasionally (which might be after a very long time, sometimes even hours) so no point tailing them. On the other hand it's very easy to write a custom MyPrint() function to print to your own log file and have it flush on EACH write. Replace Print() with MyPrint() and load the log file in the tail program. Then u can always c the last lines of the log file in real time. You always know whats going on.


Most tail program also have the ability to add auto coloring of lines according to specific criteria, like key words, etc. So for example u can have the program color all lines with the word 'error' in red, the word 'warning' in yellow, etc. Some tail programs also have the ability to search or filter lines, etc. So bottom line, it's much much more versatile then using Print(), Alert() or Comment().


Hi CB, Gordon and Phy,

This sounds like it is better than nothing and will be of some assistance.

. . . . . (8 >) . Thanks and Happy New Year to One and All . (< 8)



 
gordon:
Again I would recommend a freeware called baretail. I have checked over 15 tail programs for windows until I landed on this one. It's the only tail program I have seen that can open ANY sized file within <1sec while keeping a constant fixed and small memory print. The freeware version has gota nag screen but otherwise is fully functional. http://www.baremetalsoft.com/baretail/

Hi gordon,

I'm not exactly sure just what a 'tail' program is, but I'll check the one taht you are recommending out.

Thanks Gordon.

 

'Take it like a 'Man'' meikel!? You've got to be kidding! If all you have to offer is some lame character assassinations based on completely irrelevant, insignificant and petty grudges, take them somewhere else like the kiddies sandbox where such immature behavior is usually found. They only show YOU as being desperate and pathetic over somethings so meaningless and trivial as the usage of different available fonts that are provided here for them to be used. Take your GIGO mode somewhere else. I'm inquiring about a technical matter and capacity of MQL4, not a contest over who can be the most pathetic here. Though you clearly are the 'winner' in that matter. Congratulations on such a worthwhile and beneficial achievement. I have no interest in getting into trading immature insults over ridiculous things and won't indulge you and 'support' your continuation of such behavior. If you don't have something beneficial to offer, then don't bother posting it here or anyplace else that I make a posting to that you can and may jump on and continue on with such destructive, useless immature behavior that you make in response to anything I post. I don't know what your problem is, but it most definitely IS YOUR PROBLEM and not mine and I won't continue to play such infantile games with you.

. . . . . (8 >) . Happy new year! . (< 8)

 
DougRH4x:

Hi gordon,

I'm not exactly sure just what a 'tail' program is, but I'll check the one taht you are recommending out.

Thanks Gordon.

It's similar to a text editor for text files (such as the mt4 log file) with 2 main differences:

- you can't edit the text, just view it

- the program 'tails' the file in real time, that means u always see the last lines of the file in real time


This is NOT very useful for the built in MT4 logs (experts and journal logs) since they are not flushed on each write. They are only flushed occasionally (which might be after a very long time, sometimes even hours) so no point tailing them. On the other hand it's very easy to write a custom MyPrint() function to print to your own log file and have it flush on EACH write. Replace Print() with MyPrint() and load the log file in the tail program. Then u can always c the last lines of the log file in real time. You always know whats going on.


Most tail program also have the ability to add auto coloring of lines according to specific criteria, like key words, etc. So for example u can have the program color all lines with the word 'error' in red, the word 'warning' in yellow, etc. Some tail programs also have the ability to search or filter lines, etc. So bottom line, it's much much more versatile then using Print(), Alert() or Comment().

 
cloudbreaker:

Doug,


How do you think that Alert(GetLastError()) would give you a more "immediate" response than Print(GetLastError())?

You've really lost me this time, Doug.

The difference between Alert(), Comment() and Print() is in HOW the information is delivered, not WHAT or WHEN.


CB

Hi CB,

Duly noted. I was thinking that the alert, or something similar would immediately spawn a child window with the 'alert/error message' and halt teh program execution but obviously not. To bad

 
DougRH4x:

but it most definitely IS YOUR PROBLEM and not mine

i already have noticed some time ago that you think in this way...

 
What's new about it? It's a new piece of software and it's the first tool I've used which works like a traditional debugger on MQL. I personally don't use the platform for live trading yet as I think it is not mature enough. But you can set up a ProTrader Demo account and try it that way. If you have problems, I suggest you post them on the relevant PT forum where Nicky will help you. CB