summaryrefslogtreecommitdiffstats
path: root/src/Logger.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Logger.h')
-rw-r--r--src/Logger.h32
1 files changed, 9 insertions, 23 deletions
diff --git a/src/Logger.h b/src/Logger.h
index e0680e125..ef86b3313 100644
--- a/src/Logger.h
+++ b/src/Logger.h
@@ -6,19 +6,10 @@ class cLogger
{
public:
- enum eLogLevel
- {
- llRegular,
- llInfo,
- llWarning,
- llError,
- };
-
-
class cListener
{
public:
- virtual void Log(AString a_Message, eLogLevel a_LogLevel) = 0;
+ virtual void Log(std::string_view a_Message, eLogLevel a_LogLevel) = 0;
virtual ~cListener(){}
};
@@ -59,23 +50,17 @@ public:
};
/** Log a message formatted with a printf style formatting string. */
- void vLogPrintf(const char * a_Format, eLogLevel a_LogLevel, fmt::printf_args a_ArgList);
- template <typename... Args>
- void LogPrintf(const char * a_Format, eLogLevel a_LogLevel, const Args & ... args)
- {
- vLogPrintf(a_Format, a_LogLevel, fmt::make_printf_args(args...));
- }
+ void LogPrintf(
+ std::string_view a_Format, eLogLevel a_LogLevel, fmt::printf_args a_ArgList
+ );
/** Log a message formatted with a python style formatting string. */
- void vLogFormat(const char * a_Format, eLogLevel a_LogLevel, fmt::format_args a_ArgList);
- template <typename... Args>
- void LogFormat(const char * a_Format, eLogLevel a_LogLevel, const Args & ... args)
- {
- vLogFormat(a_Format, a_LogLevel, fmt::make_format_args(args...));
- }
+ void LogFormat(
+ std::string_view a_Format, eLogLevel a_LogLevel, fmt::format_args a_ArgList
+ );
/** Logs the simple text message at the specified log level. */
- void LogSimple(const AString & a_Message, eLogLevel a_LogLevel = llRegular);
+ void LogSimple(std::string_view a_Message, eLogLevel a_LogLevel = eLogLevel::Regular);
cAttachment AttachListener(std::unique_ptr<cListener> a_Listener);
@@ -88,6 +73,7 @@ private:
std::vector<std::unique_ptr<cListener>> m_LogListeners;
void DetachListener(cListener * a_Listener);
+ void LogLine(std::string_view a_Line, eLogLevel a_LogLevel);
};