Doxygen Samurai Engine 0.0.1
Doxygen Samurai Engine Documentation
Loading...
Searching...
No Matches
log.h
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <deque>
4#include <sstream>
5
6namespace samurai
7{
8 enum logType
9 {
13 };
14
16 {
17
18 static constexpr const char *DefaultLogFile = SAMURAI_RESOURCES_PATH "logs.txt";
19
20 //a null name will just log to a internal structure
21 void init(std::string name);
22
23
24
25 //this will be dependent on the configuration of the project.
26 void log(const char *l, int type = samurai::logNormal);
27
28
29 std::string name = "";
30 bool firstLog = 0;
31
32 std::deque<std::string> internalLogs;
33 static constexpr int maxInternalLogCount = 200;
34
35
36 private:
37 //used only interally.
38 void logToFile(const char *l, int type = samurai::logNormal);
39 void logInternally(const char *l, int type = samurai::logNormal);
40
41 };
42
43
44 void logToFile(const char *fileName, const char *l, int type = samurai::logNormal);
45
46
47}
void logToFile(const char *fileName, const char *l, int type=samurai::logNormal)
Definition log.cpp:69
logType
Definition log.h:9
@ logWarning
Definition log.h:11
@ logNormal
Definition log.h:10
@ logError
Definition log.h:12
void logInternally(const char *l, int type=samurai::logNormal)
Definition log.cpp:58
std::string name
Definition log.h:29
std::deque< std::string > internalLogs
Definition log.h:32
void logToFile(const char *l, int type=samurai::logNormal)
Definition log.cpp:45
void log(const char *l, int type=samurai::logNormal)
Definition log.cpp:14
static constexpr const char * DefaultLogFile
Definition log.h:18
static constexpr int maxInternalLogCount
Definition log.h:33
void init(std::string name)
Definition log.cpp:6