summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/common/Logger.cpp14
-rw-r--r--src/core/common/Logger.hpp12
2 files changed, 18 insertions, 8 deletions
diff --git a/src/core/common/Logger.cpp b/src/core/common/Logger.cpp
index ab62b03..1811b68 100644
--- a/src/core/common/Logger.cpp
+++ b/src/core/common/Logger.cpp
@@ -118,6 +118,16 @@ public:
return ss.str();
}
+ std::string bright() const
+ {
+ if (!active) {
+ return std::string{};
+ }
+ std::stringstream ss;
+ ss << "\x1b[1m";
+ return ss.str();
+ }
+
std::string reset() const
{
if (!active) {
@@ -152,7 +162,7 @@ void TerminalLogger::processMessage(Message msg)
std::string filename = currentFilename();
bool hasFile = !filename.empty();
if (hasFile) {
- os << t.color(Terminal::WHITE, true) << filename << t.reset();
+ os << t.bright() << filename << t.reset();
}
// Print line and column number
@@ -160,7 +170,7 @@ void TerminalLogger::processMessage(Message msg)
if (hasFile) {
os << ':';
}
- os << t.color(Terminal::WHITE, true) << msg.pos.line << t.reset();
+ os << t.bright() << msg.pos.line << t.reset();
if (msg.pos.hasColumn()) {
os << ':' << msg.pos.column;
}
diff --git a/src/core/common/Logger.hpp b/src/core/common/Logger.hpp
index be82ea0..6604756 100644
--- a/src/core/common/Logger.hpp
+++ b/src/core/common/Logger.hpp
@@ -257,7 +257,7 @@ public:
* context information.
*/
template <class PosType>
- void logAt(Severity severity, std::string msg, PosType &pos)
+ void log(Severity severity, std::string msg, PosType &pos)
{
log(severity, std::move(msg), pos.getPosition(), pos.getContext());
}
@@ -291,7 +291,7 @@ public:
void debug(std::string msg, PosType &pos)
{
#ifndef NDEBUG
- logAt(Severity::DEBUG, std::move(msg), pos);
+ log(Severity::DEBUG, std::move(msg), pos);
#endif
}
@@ -319,7 +319,7 @@ public:
template <class PosType>
void note(std::string msg, PosType &pos)
{
- logAt(Severity::NOTE, std::move(msg), pos);
+ log(Severity::NOTE, std::move(msg), pos);
}
/**
@@ -346,7 +346,7 @@ public:
template <class PosType>
void warning(std::string msg, PosType &pos)
{
- logAt(Severity::WARNING, std::move(msg), pos);
+ log(Severity::WARNING, std::move(msg), pos);
}
/**
@@ -373,7 +373,7 @@ public:
template <class PosType>
void error(std::string msg, PosType &pos)
{
- logAt(Severity::ERROR, std::move(msg), pos);
+ log(Severity::ERROR, std::move(msg), pos);
}
/**
@@ -401,7 +401,7 @@ public:
template <class PosType>
void fatalError(std::string msg, PosType &pos)
{
- logAt(Severity::FATAL_ERROR, std::move(msg), pos);
+ log(Severity::FATAL_ERROR, std::move(msg), pos);
}
/**