mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
format: reformat project
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
736cd175d5
commit
bbf33e8e4d
202 changed files with 7389 additions and 5609 deletions
|
|
@ -1,8 +1,8 @@
|
|||
#include "Logger.hpp"
|
||||
|
||||
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
#include <iomanip>
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
|
|
@ -20,15 +20,17 @@ LogMessage::~LogMessage() {
|
|||
Logger::Logger(std::string name) : name(std::move(name)) {
|
||||
}
|
||||
|
||||
void Logger::log(LogLevel level, const std::string& name, const std::string& message) {
|
||||
void Logger::log(
|
||||
LogLevel level, const std::string& name, const std::string& message
|
||||
) {
|
||||
using namespace std::chrono;
|
||||
|
||||
std::stringstream ss;
|
||||
switch (level) {
|
||||
case LogLevel::debug:
|
||||
# ifdef NDEBUG
|
||||
#ifdef NDEBUG
|
||||
return;
|
||||
# endif
|
||||
#endif
|
||||
ss << "[D]";
|
||||
break;
|
||||
case LogLevel::info:
|
||||
|
|
@ -42,10 +44,13 @@ void Logger::log(LogLevel level, const std::string& name, const std::string& mes
|
|||
break;
|
||||
}
|
||||
time_t tm = std::time(nullptr);
|
||||
auto ms = duration_cast<milliseconds>(system_clock::now().time_since_epoch()) % 1000;
|
||||
auto ms =
|
||||
duration_cast<milliseconds>(system_clock::now().time_since_epoch()) %
|
||||
1000;
|
||||
ss << " " << std::put_time(std::localtime(&tm), "%Y/%m/%d %T");
|
||||
ss << '.' << std::setfill('0') << std::setw(3) << ms.count();
|
||||
ss << utcOffset << " [" << std::setfill(' ') << std::setw(moduleLen) << name << "] ";
|
||||
ss << utcOffset << " [" << std::setfill(' ') << std::setw(moduleLen) << name
|
||||
<< "] ";
|
||||
ss << message;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue