File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ namespace paddle {
23
23
namespace lite {
24
24
namespace replace_stl {
25
25
26
+ #ifndef LITE_WITH_LOG
27
+ #define ADD_DATA_AS_STRING (data_, obj_ )
28
+ #else
29
+ #define ADD_DATA_AS_STRING (data_, obj_ ) \
30
+ std::string text = std::to_string(obj_); \
31
+ pad (text); \
32
+ data_ = data_ + text;
33
+
26
34
void ostream::pad (const std::string& text) {
27
35
if (display_width_ > 0 ) {
28
36
if (display_width_ < text.size ()) {
@@ -36,15 +44,6 @@ void ostream::pad(const std::string& text) {
36
44
}
37
45
}
38
46
}
39
-
40
- #ifndef LITE_WITH_LOG
41
- #define ADD_DATA_AS_STRING (data_, obj_ )
42
- #else
43
- #define ADD_DATA_AS_STRING (data_, obj_ ) \
44
- std::string text = std::to_string(obj_); \
45
- pad (text); \
46
- data_ = data_ + text;
47
-
48
47
#endif
49
48
50
49
template <>
Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ class ostream {
57
57
ostream& operator <<(const T* obj);
58
58
59
59
private:
60
+ #ifdef LITE_WITH_LOG
60
61
void pad (const std::string& text);
62
+ #endif
61
63
std::string data_;
62
64
int display_width_{-1 }; // -1 refers to no setting
63
65
};
You can’t perform that action at this time.
0 commit comments