Skip to content

Commit

Permalink
tg_cpphost: Logging: Add PLOGE
Browse files Browse the repository at this point in the history
  • Loading branch information
Royna2544 committed Nov 23, 2023
1 parent 384915b commit ec116c4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/include/Logging.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#pragma once

// Like the perror(2)
#ifndef __WIN32
#include <errno.h>
#include <string.h>
#define PLOG_E(fmt, ...) LOG_E(fmt ": %s", ##__VA_ARGS__, strerror(errno))
#else
#define PLOG_E LOG_E
#endif

#define LOG_F(fmt, ...) _LOG(fmt, "FATAL", ##__VA_ARGS__)
#define LOG_E(fmt, ...) _LOG(fmt, "Error", ##__VA_ARGS__)
#define LOG_W(fmt, ...) _LOG(fmt, "Warning", ##__VA_ARGS__)
Expand Down

0 comments on commit ec116c4

Please sign in to comment.