Skip to content

Commit 1ff1e05

Browse files
authored
Merge pull request #54 from erlonfs/develop
Develop
2 parents 70faacf + ce78fd7 commit 1ff1e05

File tree

6 files changed

+31
-1
lines changed

6 files changed

+31
-1
lines changed

Include/BadRobot.Framework/Account.mqh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ class Account
1919
_tradeMode = (ENUM_ACCOUNT_TRADE_MODE)AccountInfoInteger(ACCOUNT_TRADE_MODE);
2020
_marginMode = (ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE);
2121
}
22+
23+
~Account(){
24+
25+
}
26+
2227

2328
bool IsReal(){
2429
return _tradeMode == ACCOUNT_TRADE_MODE_REAL;
7.94 KB
Binary file not shown.
30.3 KB
Binary file not shown.
730 Bytes
Binary file not shown.

Include/BadRobot.Framework/Logger.mqh

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#property link "https://github.com/erlonfs"
88
#property version "1.0"
99

10+
#define MAX_SIZE_TEXT (50)
11+
1012
class Logger
1113
{
1214
private:
@@ -25,16 +27,39 @@ class Logger
2527
_logs[0] = txt;
2628
_hasChanges = true;
2729

30+
printf(txt);//TODO remove later
31+
2832
}
2933

3034
public:
3135

32-
void Log(string text) {
36+
Logger(){
37+
38+
}
39+
40+
~Logger(){
41+
42+
}
3343

44+
Logger(const Logger& other){
45+
this = other;
46+
}
47+
48+
void Log(string text)
49+
{
50+
51+
if(text == NULL) return;
52+
3453
StringToUpper(text);
3554
StringTrimLeft(text);
3655
StringTrimRight(text);
3756

57+
int length = StringLen(text);
58+
if(length > MAX_SIZE_TEXT + 3)
59+
{
60+
text = StringSubstr(text, 0, MAX_SIZE_TEXT - 3) + "...";
61+
}
62+
3863
string newText = (TimeToString(TimeCurrent(), TIME_SECONDS)) + " > " + text;
3964

4065
if(Logger::Last() == NULL){

0 commit comments

Comments
 (0)