Login / Register
Add a review
Log in
Sign UP
[bws_google_captcha]

The CLogger class is designed for a simple but effective log utility that can be used to output messages. Message levels, such as INFO or ERROR, allow you to determine their significance. You can specify a level in CLogger, and then only messages of this level and higher will be saved.

The following levels are available:

  • DEBUG: Low-level information for developers.
  • INFO: general (useful) information about the operation of the system.
  • WARNING: warning.
  • ERROR: An error.
  • DEBUG: Low-level information for developers.
  • INFO: general (useful) information about the operation of the system.
  • WARNING: warning.
  • ERROR: An error.

LOGGER_START(minimumLevel, folderName=NULL) – starts the logging function.

minimumLevel: Messages of this level and higher will be saved.

folderName: the path of the subfolder in MQL5Files.

LOGGER_STOP—) – stops the logging function.

LOGGER_WRITE(level, message)-writes a string to a log file.

level: message type.

message: the text of the message.

LOGGER_DELETE() – closes the Logger.

The saved log files are available in the folder (in the terminal menu, click “File” ->” >Open the data file”):

[spoiler title=”Read More…”]

MQL5Files

MQL5Files

MQL5IncludeCLogger.mqh

MQL5IncludeCLogger.mqh

MQL5ExpertsLoggerTest.mq5

MQL5ExpertsLoggerTest.mq5

See result on Screenshot.

To call the function correctly, the library should be used in build 670 and higher.

[/spoiler]

Add review
Reviews ( 0 ):