HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
ConsoleLogger.h
Go to the documentation of this file.
1#pragma once
2#include "HephShared.h"
3#include <string>
4
7#define HEPH_CL_INFO "36"
8#define HEPH_CL_WARNING "33"
9#define HEPH_CL_ERROR "31"
10#define HEPH_CL_SUCCESS "32"
11#define HEPH_CL_DEBUG "35"
12
13namespace Heph
14{
20 {
21 private:
22#if defined(HEPH_CL_DISABLE_COLORED_OUTPUT)
23 static inline bool coloredOutput = false;
24#else
25 static inline bool coloredOutput = true;
26#endif
27
28 public:
29 ConsoleLogger() = delete;
30 ConsoleLogger(const ConsoleLogger&) = delete;
31 ConsoleLogger& operator=(const ConsoleLogger&) = delete;
32
33 public:
39 static void Log(const std::string& message, const char* logLevel);
40
47 static void Log(const std::string& message, const char* logLevel, const std::string& libName);
48 static void LogInfo(const std::string& message);
49 static void LogInfo(const std::string& message, const std::string& libName);
50 static void LogWarning(const std::string& message);
51 static void LogWarning(const std::string& message, const std::string& libName);
52 static void LogError(const std::string& message);
53 static void LogError(const std::string& message, const std::string& libName);
54 static void LogSuccess(const std::string& message);
55 static void LogSuccess(const std::string& message, const std::string& libName);
56 static void LogDebug(const std::string& message);
57 static void LogDebug(const std::string& message, const std::string& libName);
58
63 static void EnableColoredOutput();
64
69 static void DisableColoredOutput();
70
71 private:
72 static std::string CurrentTimeToString();
73 static std::string GetLogLevelName(const char* logLevel);
74 };
75}
#define HEPH_API
Definition HephShared.h:132
class for printing formatted messages to the console.
Definition ConsoleLogger.h:20
static void Log(const std::string &message, const char *logLevel)
static void EnableColoredOutput()
static void DisableColoredOutput()
static void Log(const std::string &message, const char *logLevel, const std::string &libName)