Any way to get PRINT messages saved into logfile?

 

When buying/selling, i always add a "print" message to explain which open/close method was used. It is displayed in the "Experts" tab, but not in the txt log file that has a date as name.

If that is intented, it would be NICE to have print message added to log file!

THanks :) 

 

right click on one of the lines in Experts ---> Open and you will see it

or restart the terminal and you are gonna find it in the file

 

Thanks a million Qjol !

Indeed !!! I was looking in the log folder when you do File\Open Data Folder, and there in the log file you dont have the "print" messages.... Not sure why they are two log files not with the same format !

Have a nice weekend 

 

this is my function to save to my own log file,the same parameter with print function

//+------------------------------------------------------------------+
//| Write usefull log to file                                        |
//+------------------------------------------------------------------+
void WriteToLogFile(string logstring)
{
    int handle;
    string filedatestr = "" + (string)TimeYear(TimeCurrent()) + "_" + (string)TimeMonth(TimeCurrent()) + "_" + (string)TimeDay(TimeCurrent()) + "";
    handle = FileOpen("mylog_" + filedatestr + ".txt", FILE_READ|FILE_WRITE);
    string baseinfo = TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS);
    baseinfo = baseinfo + " Balance:" + (string)AccountBalance() + " Equity:" + (string)AccountEquity() + "\nMargin:" + (string)AccountMargin() + " FreeMargin:" + (string)AccountFreeMargin() + "\n";
    if(handle > 0)
    {
        FileSeek(handle, 0, SEEK_END);
        FileWrite(handle,baseinfo,logstring);
        FileClose(handle);
    }
}

 FYI

Reason: