Chronos 0.0
A advanced 2D rendering and animation system
Loading...
Searching...
No Matches
logging.hpp File Reference
#include <iostream>
#include <filesystem>
#include <chrono>
#include <iomanip>
#include <sstream>
Include dependency graph for logging.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LOG(LEVEL, MESSAGE)
 

Functions

static std::string getFileName (const std::string &path)
 
static std::string getTimestamp ()
 

Macro Definition Documentation

◆ LOG

#define LOG (   LEVEL,
  MESSAGE 
)

Definition at line 60 of file logging.hpp.

Function Documentation

◆ getFileName()

static std::string getFileName ( const std::string &  path)
inlinestatic

Definition at line 33 of file logging.hpp.

34{
35 std::filesystem::path p(path);
36 return p.filename().string();
37}

◆ getTimestamp()

static std::string getTimestamp ( )
inlinestatic

Definition at line 39 of file logging.hpp.

40{
41 auto now = std::chrono::system_clock::now();
42 auto now_ns = std::chrono::duration_cast<std::chrono::milliseconds>(
43 now.time_since_epoch())
44 .count();
45 std::ostringstream oss;
46 oss << now_ns;
47 return oss.str();
48}