From 8a4192278e8bc5f5646b8bb582b7db336cc661ac Mon Sep 17 00:00:00 2001 From: Flavio Sousa Date: Fri, 2 Aug 2019 18:50:24 -0300 Subject: [PATCH 1/2] Add setConfLogFile --- log4mql.mqh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/log4mql.mqh b/log4mql.mqh index 322bedb..49ebd50 100644 --- a/log4mql.mqh +++ b/log4mql.mqh @@ -147,6 +147,14 @@ public: instance = NULL; } + static void setConfLogFile(string logFile) + { + if(instance!=NULL) { + instance.confLogFile=logFile; + instance.closeLogFile(); + } + } + public: /** * Trace From 95d7bb022ab4c841e2618fa691350210b20e817d Mon Sep 17 00:00:00 2001 From: Flavio Sousa Date: Mon, 19 Aug 2019 18:27:33 -0300 Subject: [PATCH 2/2] Add documentation for logger.setConfLogFile --- .gitignore | 1 + README.md | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..600d2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode \ No newline at end of file diff --git a/README.md b/README.md index 0e46dd3..d0b680f 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,13 @@ CLog4mql::release(); logger.release(); +## Filename +You can set dynamically the file name of log with: +

+const string typeLog=(IsDemo()?"demo":"real";
+logger.setConfLogFile(StringFormat("log4mql-%s-%s.log",typeLog,Symbol()));
+
+ ## Directories The directory for the log4mql.conf and the log4mql.log files * Normal mode: `/MQL4/Files/`