SklavaBot 0.1.0
Telegram Bot in C++
Loading...
Searching...
No Matches
utils.hpp
Go to the documentation of this file.
1#ifndef HPP_UTILS
2#define HPP_UTILS
3
4#include <cstdint>
5#include <iostream>
6#include <string>
7
8namespace tools {
15void flush();
16
28void log_cmd(std::string command, std::string user, std::int32_t timestamp,
29 const std::string log_type);
30} // namespace tools
31
36namespace LOG {
37
38#define FG_BRED "\033[1;31m"
39#define FG_BYELLOW "\033[1;33m"
40#define FG_BGREEN "\033[1;32m"
41#define FG_BWHITE "\033[1;37m"
42#define RESET "\033[0m"
43
44const std::string Info = FG_BWHITE "[INFO]" RESET;
45const std::string Warn = FG_BYELLOW "[WARN]" RESET;
46const std::string Error = FG_BRED "[ERROR]" RESET;
47const std::string Debug = FG_BGREEN "[DEBUG]" RESET;
48} // namespace LOG
49
50#endif
Defined LOG types.
Definition utils.hpp:36
const std::string Warn
Definition utils.hpp:45
const std::string Info
Definition utils.hpp:44
const std::string Error
Definition utils.hpp:46
const std::string Debug
Definition utils.hpp:47
Definition metar.hpp:6
void log_cmd(std::string command, std::string user, std::int32_t timestamp, const std::string log_type)
Function to print a better log.
Definition utils.cpp:17
void flush()
Flush stdin.
Definition utils.cpp:12
#define FG_BRED
Definition utils.hpp:38
#define FG_BYELLOW
Definition utils.hpp:39
#define FG_BGREEN
Definition utils.hpp:40
#define RESET
Definition utils.hpp:42
#define FG_BWHITE
Definition utils.hpp:41