-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvm_log.cpp
38 lines (30 loc) · 888 Bytes
/
vm_log.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "vm_log.h"
#include <iostream>
#include <cstdlib>
#include <format>
#include <Windows.h>
#include "vm_version.h"
namespace vm_log
{
void output(const std::string& info){
std::cout << info << '\n';
}
void change_title(const std::string& info){
std::string output = std::format("{0} {1} v{2}", info, PROGRAM_NAME, VERSION);
//std::cout << "\033]0;" << output << "\007";
SetConsoleTitle(output.c_str());
}
void error(const std::string& info){
std::cerr << "\033[31m[" << PROGRAM_NAME << " ERROR]\033[0m " << info << '\n';
}
void errore(const std::string& info){
error(info);
std::exit(EXIT_SUCCESS);
}
void warning(const std::string& info){
std::cerr << "\033[33m[" << PROGRAM_NAME << " WARNING]\033[0m " << info << '\n';
}
void info(const std::string& info){
std::cerr << "\033[35m[" << PROGRAM_NAME << " INFO]\033[0m " << info << '\n';
}
}