NoJobEngine 2.0.7
Loading...
Searching...
No Matches
Log.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <iostream>
9#include <mutex>
10#include <string_view>
11
12namespace NoJob
13{
14 class Log
15 {
16 public:
17 static void Info(std::string_view message) { Write("INFO", message); }
18 static void Warn(std::string_view message) { Write("WARN", message); }
19 static void Error(std::string_view message) { Write("ERROR", message); }
20
21 private:
22 static void Write(std::string_view level, std::string_view message)
23 {
24 static std::mutex mutex;
25 std::lock_guard<std::mutex> lock(mutex);
26 std::cerr << "[NoJob][" << level << "] " << message << '\n';
27 }
28 };
29}
static void Warn(std::string_view message)
Definition Log.h:18
static void Info(std::string_view message)
Definition Log.h:17
static void Error(std::string_view message)
Definition Log.h:19