Logify - Log management library - MetaTrader 5 library | Forex indicator download - MT4/MT5 resources
Logify is a logging library for MQL designed to simplify debugging, tracking and monitoring of EAs and indicators. It provides structured, customizable and organized logging directly on the chart or terminal, and supports log levels, flexible formats and multiple handlers. A lightweight and elegant solution that can be easily integrated into your MQL project.
📦 Features
🚀 Installation
MQL5/include/
#include
🔧 Quick Start Example
Simple example using default settings:
//+------------------------------------------------------------------+ //|Import | //+------------------------------------------------------------------+ #includeCLogify logic; //+------------------------------------------------------------------+ //|Expert initialization function | //+------------------------------------------------------------------+ Integer initialization () { //--- Sample log Logify.Debug( "Initialization Start" ); Logical.Info( "Account balance is normal" ); Logicalize. Alert ( "Profit Reached" ); Logify.Error( "Failed to send order" , "Command" , "Reason: No money" ); Logify.fatal( "serious error: invalid input parameter" ); //--- return ( initialization successful ); } //+------------------------------------------------------------------+
Advanced example with custom handler settings. In this example, we save logging to a file and graph annotation. Customized settings for everyone.
//+------------------------------------------------------------------+ //|Import | //+------------------------------------------------------------------+ #includeCLogify logic; //+------------------------------------------------------------------+ //|Expert initialization function | //+------------------------------------------------------------------+ Integer initialization () { //--- Configure comment handler MqlLogifyHandleCommentConfig config_comment; config_comment.size = 10 ; config_comment.frame_style = LOG_FRAME_STYLE_SINGLE; config_comment.direction = LOG_DIRECTION_UP; Configuration comment.title = "My Expert" ; //--- Create and configure comment handler CLogifyHandlerComment *handler_comment = new CLogifyHandlerComment(); handler_comment.SetConfig(config_comment); handler_comment.SetLevel(LOG_LEVEL_DEBUG); handler_comment.SetFormatter( new CLogifyFormatter( "{date_time} [{levelname}]:{msg}" , "hour:minute:second" )); //--- Configuration file handler MqlLogifyHandleFileConfig file configuration; file_config.CreateDateRotationConfig( "My Expert" , "Log" ,LOG_FILE_EXTENSION_LOG, 10 , 100 , CP_UTF8 ); //--- Create and configure the file handler CLogifyHandlerFile *handler_file = new CLogifyHandlerFile(); handler_file.SetConfig(file_config); handler_file.SetLevel(LOG_LEVEL_DEBUG); handler_file.SetFormatter( new CLogifyFormatter( "{datetime}[{level name}]:{msg}({filename}|{origin}|{function})" , "hour:minute:second" )); //--- Additional handler Logify.AddHandler(handler_comment); Logify.AddHandler(handler_file); //--- Sample log Logify.Debug( "Initialization Start" ); Logical.Info( "Account balance is normal" ); Logicalize. Alert ( "Profit Reached" ); Logify.Error( "Failed to send order" , "Command" , "Reason: No money" ); Logify.fatal( "Fatal error: Invalid input parameter" ); //--- return ( initialization successful ); } //+------------------------------------------------------------------+
To understand each setting, I recommend reading the following article where I explain each step of library development:
✔️ Log level
🖥️Includes handler
Each handler defines where the log is displayed or stored.
You can use one or combine multiple handlers at the same time, such as graphics+file+console.
🛠️ Log format
Format pattern example:
"{date_time}[{levelname}]:{msg}"Available tokens:
⚖️ License
MIT License - Free for personal and commercial projects.
👨💻 Author
The developer , Joao Pedro Jeff , focuses on making MQL development more professional, orderly and efficient.
Attachment download
📎LogifySimpleExample.mq5 (1.86 KB)
📎LogifyCompleteExample.mq5 (3.01 KB)
📎 Logify.mqh (25.24 KB)
📎 LogifyBuilder.mqh (29.16 KB)
📎 LogifyLevel.mqh (0.95 KB)
📎 LogifyModel.mqh (5.86 KB)
📎IntervalWatcher.mqh (8.08 KB)
📎 LogifySuppression.mqh (25 KB)
📎LogifyHandler.mqh (5.29 KB)
📎LogifyHandlerComment.mqh (22.95 KB)
📎LogifyHandlerConsole.mqh (6.69 KB)
📎 LogifyHandlerDatabase.mqh (30.41 KB)
📎LogifyHandlerFile.mqh (17.98 KB)
📎LogifyFormatter.mqh (26.24 KB)
📎 ErrorMessages.de.mqh (104.32 KB)
📎 ErrorMessages.en.mqh (98.69 KB)
📎 ErrorMessages.es.mqh (50.74 KB)
📎 ErrorMessages.fr.mqh (52.76 KB)
📎 ErrorMessages.it.mqh (51.84 KB)
📎 ErrorMessages.ja.mqh (54.7 KB)
📎 ErrorMessages.ko.mqh (52.02 KB)
📎 ErrorMessages.pt.mqh (103.81 KB)
📎 ErrorMessages.ru.mqh (59.88 KB)
📎 ErrorMessages.tr.mqh (49.46 KB)
📎 ErrorMessages.zh.mqh (48.09 KB)
📎Error.mqh (0.55 KB)
📎LogifyError.mqh (14.29 KB)
Source: MQL5 #59821
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •