1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- /*
- * 2D Game Engine
- * Logger.h:
- * Based on pikuma.com 2D game engine in C++ and Lua course
- * Copyright (c) 2021 986-Studio. All rights reserved.
- *
- * Created by Manoël Trapier on 11/02/2021.
- */
- #ifndef GAMEENGINE_LOGGER_H
- #define GAMEENGINE_LOGGER_H
- #include <time.h>
- #include <vector>
- typedef enum LogType
- {
- LOG_LOG = 0,
- LOG_ERROR,
- LOG_WARNING,
- LOG_INFO,
- LOG_CRITICAL,
- LOG_DEBUG,
- } LogType;
- typedef struct LogEntry
- {
- LogType type;
- time_t timestamp;
- char *message;
- } LogEntry;
- class Logger
- {
- public:
- /* C++ is stupid. */
- static std::vector<LogEntry> messages;
- static void Log(const char *message, ...);
- static void Error(const char *message, ...);
- static void Warning(const char *message, ...);
- static void Info(const char *message, ...);
- static void Critical(const char *message, ...);
- static void Debug(const char *message, ...);
- };
- #endif /* GAMEENGINE_LOGGER_H */
|