Download MetaTrader 5
To add comments, please log in or register
Let your idle PCs do something useful. Join MQL5 Cloud Network!
MetaQuotes Software Corp.
Moderator
177434
MetaQuotes Software Corp. 2011.02.23 18:21 

New article Finding Errors and Logging is published:

MetaEditor 5 has the debugging feature. But when you write your MQL5 programs, you often want to display not the individual values, but all messages that appear during testing and online work. When the log file contents have large size, it is obvious to automate quick and easy retrieval of required message. In this article we will consider ways of finding errors in MQL5 programs and methods of logging. Also we will simplify logging into files and will get to know a simple program LogMon for comfortable viewing of logs.

Author: Дмитрий Александрович

Brett Luedtke
113
Brett Luedtke 2011.02.27 08:53  

The attached .exe is still in Russian language. Can you please re-up it?

P.S. This is really useful! One of the first classes that should be declared in any OOP project is one to handle errors!

MetaQuotes Software Corp.
Moderator
177434
MetaQuotes Software Corp. 2011.03.17 15:48  
Thank you for your comment. Now you can find correct English version of this utility in attached files.
nelson75
5
nelson75 2013.08.16 23:21  

If you forget to use flush, data loss may occur.

 A better solution would be the following:


private:
   void              flush(void);              // Flushing cache into file
//+------------------------------------------------------------------+
//|   Deinitialization                                               |
//+------------------------------------------------------------------+
void CLogger::deinit(void)
  {
   flush();  // Flush data
   FileClose(handleFile); // Close file
  }

So that the data save is automatically.

 

ps.: I'm sorry if I offended spelling, the google translator helped me...

/
To add comments, please log in or register