Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Log4mql - MetaTrader 4 library | MT4 EA download - MetaTrader 4 resources

author EAcpu | 5 reads | 0 comments |

Log4mql - library for MetaTrader 4

Log4mql is an MQL4 (MetaQuotes MetaTrader 4 Language) library for flexible logging to files and terminal console. It is modeled after the Log4j Java library.

Documentation (GitHub): https://github.com/swaypnet/Log4mql

Usage in your code:

 CLog4mql::getInstance().error( __file__ , __line__ , "Something unexpected happened" );

or (for more frequent use)

 CLog4mql* logger = CLog4mql::getInstance();
Logger.Error( __file__ , __line__ , "Something unexpected happened" );
Logger.info( __file__ , __line__ , "Complete calculation" );
logger.debug( __file__ , __line__ , string format ( "The result of %s is %d" , string1, value1));

Don't forget at the end of your EA/indicator/script:

 CLog4mql::release();

or

 Logger.release();

Table of contents:

Directory of log4mql.conf and log4mql.log files

You can configure the desired log level for the output in the configuration file for each additional file and/or the global default.

Log4mql - library for MetaTrader 4


Attachment download

📎 log4mql.mqh (16.61 KB)

Source: MQL5 #13382

Verification code Refresh