Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
LogFormatClion.h
Go to the documentation of this file.
1#pragma once
2
3#include <plog/Record.h>
4#include <plog/Util.h>
5#include <iomanip>
6
7namespace plog
8{
10 {
11 public:
12 static util::nstring header()
13 {
14 return util::nstring();
15 }
16
17 static util::nstring format(const Record& record)
18 {
19 tm t;
20 util::localtime_s(&t, &record.getTime().time);
21
22 util::nostringstream ss;
23 ss << t.tm_year + 1900 << "-" << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mon + 1 << PLOG_NSTR("-") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mday << PLOG_NSTR(" ");
24 ss << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_hour << PLOG_NSTR(":") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_min << PLOG_NSTR(":") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_sec << PLOG_NSTR(".") << std::setfill(PLOG_NSTR('0')) << std::setw(3) << static_cast<int> (record.getTime().millitm) << PLOG_NSTR(" ");
25 ss << std::setfill(PLOG_NSTR(' ')) << std::setw(5) << std::left << severityToString(record.getSeverity()) << PLOG_NSTR(" ");
26 ss << PLOG_NSTR("[") << record.getTid() << PLOG_NSTR("] ");
27 ss << PLOG_NSTR("[") << record.getFunc() << PLOG_NSTR("@") << record.getLine() << PLOG_NSTR("] ");
28 ss << record.getMessage() << PLOG_NSTR("\n");
29
30 return ss.str();
31 }
32 };
33
35}
static util::nstring format(const Record &record)
static util::nstring header()