Skip to content

Commit

Permalink
Turn off the TRACE output by default (OpenAtomFoundation#1808)
Browse files Browse the repository at this point in the history
* turn off the TRACE output by default

* added a switch called "TRACE_ON"

---------

Co-authored-by: cjh <[email protected]>
  • Loading branch information
cheniujh and cheniujh authored Jul 25, 2023
1 parent 4ea9e2e commit f104cda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/storage/src/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
#define SRC_DEBUG_H_

#ifndef NDEBUG
# define TRACE(M, ...) fprintf(stderr, "[TRACE] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
# define DEBUG(M, ...) fprintf(stderr, "[Debug] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#else
# define TRACE(M, ...) {}
# define DEBUG(M, ...) {}
#endif // NDEBUG

#ifdef TRACE_ON
# define TRACE(M, ...) fprintf(stderr, "[TRACE] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#else
# define TRACE(M, ...) {}
#endif

#endif // SRC_DEBUG_H_

0 comments on commit f104cda

Please sign in to comment.