Skip to content

Commit

Permalink
put logger catch back
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Feb 4, 2021
1 parent cd68a0f commit c45d8b5
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/shared/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)

#define COMMON_FORMATTER(name, format, ...) \
try { \
fmt::print("[" name "] " format "\n", __VA_ARGS__); \
} catch (...) {} // shit don't work
#define COMMON_FORMATTER(name, format, ...) \
try \
{ \
fmt::print("[" name "] " format "\n", __VA_ARGS__); \
} \
catch (fmt::format_error & e) \
{ \
puts("Formatting exception:" format); \
puts(__FILE__ " at " TOSTRING(__LINE__)); \
puts(e.what()); \
} \
catch (...) \
{ \
}

#define PANIC(format, ...) \
do { \
Expand Down

0 comments on commit c45d8b5

Please sign in to comment.