summaryrefslogtreecommitdiff
path: root/src/log.hpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-06-12 21:41:41 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-06-13 20:22:51 +0800
commit6f7b994684032060f0a2d7af82f4f3572293b8d6 (patch)
tree793d328cbcd6761365267550b55db45aee9b21fc /src/log.hpp
parent6a51ab4525c59e9fe2bdbd92493019b0a98c6b94 (diff)
internal!: organized internal structure, using cmake now
Diffstat (limited to 'src/log.hpp')
-rw-r--r--src/log.hpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/log.hpp b/src/log.hpp
deleted file mode 100644
index a4654c4..0000000
--- a/src/log.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#pragma once
-#include "IOManager.hpp"
-#include "format.hpp"
-#include <print>
-#include <string>
-
-inline void log(FILE *_stream, eFormatType type, std::string str) {
-#ifndef DEBUG
- if (type == TRACE)
- return;
-#endif
- if (g_pIOManager)
- g_pIOManager->addLog({.type = type, .log = str});
- else
- std::println(_stream, "{}", NFormatter::fmt(type, str));
-}
-
-template <typename... Args>
-void log(FILE *_stream, eFormatType type, std::format_string<Args...> fmt, Args &&...args) {
-#ifndef DEBUG
- if (type == TRACE)
- return;
-#endif
- if (g_pIOManager)
- g_pIOManager->addLog({.type = type, .log = NFormatter::fmt(NONEWLINE, fmt, std::forward<Args>(args)...)});
- else
- std::println(_stream, "{}", NFormatter::fmt(type, fmt, std::forward<Args>(args)...));
-}
-
-inline void log(eFormatType type, std::string str) {
- log(type == ERR ? stderr : stdout, type, str);
-}
-
-template <typename... Args>
-void log(eFormatType type, std::format_string<Args...> fmt, Args &&...args) {
- log(type == ERR ? stderr : stdout, type, fmt, std::forward<Args>(args)...);
-}