Testing Corrade on Logging
This commit is contained in:
@@ -8,7 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef GUARD_TOURMALINE_LOGGING_H
|
#ifndef GUARD_TOURMALINE_LOGGING_H
|
||||||
#define GUARD_TOURMALINE_LOGGING_H
|
#define GUARD_TOURMALINE_LOGGING_H
|
||||||
#include <array>
|
|
||||||
|
#include "Corrade/Containers/Array.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
@@ -31,7 +33,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::fstream File;
|
static std::fstream File;
|
||||||
static std::array<std::pair<const std::string, const std::string>, 6>
|
static Corrade::Containers::Array<
|
||||||
|
std::pair<const std::string, const std::string>>
|
||||||
LogLevelToString;
|
LogLevelToString;
|
||||||
};
|
};
|
||||||
} // namespace Tourmaline::Systems
|
} // namespace Tourmaline::Systems
|
||||||
|
|||||||
@@ -7,8 +7,10 @@
|
|||||||
* obtain one at http://mozilla.org/MPL/2.0/.
|
* obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../headers/Systems/Logging.hpp"
|
#include "Systems/Logging.hpp"
|
||||||
|
#include "Corrade/Containers/Array.h"
|
||||||
|
|
||||||
|
#include <Corrade/Tags.h>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
@@ -24,16 +26,18 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
using namespace Tourmaline::Systems;
|
using namespace Tourmaline::Systems;
|
||||||
|
using namespace Corrade::Containers;
|
||||||
|
|
||||||
// This is what happens when it takes you 50 years to implement
|
// This is what happens when it takes you 50 years to implement
|
||||||
// reflections to a language
|
// reflections to a language
|
||||||
std::array<std::pair<const std::string, const std::string>, 6>
|
Array<std::pair<const std::string, const std::string>>
|
||||||
Logging::LogLevelToString{std::pair{"Critical", "[0;31m"},
|
Logging::LogLevelToString{Corrade::InPlaceInit,
|
||||||
|
{std::pair{"Critical", "[0;31m"},
|
||||||
{"Error", "[0;91m"},
|
{"Error", "[0;91m"},
|
||||||
{"Warning", "[0;33m"},
|
{"Warning", "[0;33m"},
|
||||||
{"Info", "[0;37m"},
|
{"Info", "[0;37m"},
|
||||||
{"Debug", "[0;92m"},
|
{"Debug", "[0;92m"},
|
||||||
{"Trace", "[0;36m"}};
|
{"Trace", "[0;36m"}}};
|
||||||
std::fstream Logging::File;
|
std::fstream Logging::File;
|
||||||
|
|
||||||
void Logging::LogToFile(std::string File) {
|
void Logging::LogToFile(std::string File) {
|
||||||
|
|||||||
Reference in New Issue
Block a user