diff options
Diffstat (limited to 'src/format.hpp')
| -rw-r--r-- | src/format.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/format.hpp b/src/format.hpp index 42a4458..dd210c0 100644 --- a/src/format.hpp +++ b/src/format.hpp @@ -9,6 +9,7 @@ enum eFormatType : int8_t { WARN, ERR, SYS, + NONEWLINE }; namespace NFormatter { @@ -34,8 +35,10 @@ inline std::string fmt(eFormatType type, std::string str) { prefix = ""; break; } - if (!str.empty() && str.back() != '\n' && !prefix.empty()) + + if (str.back() != '\n' && type != NONEWLINE) str += '\n'; + return prefix + str; } |
