Skip to content

Commit

Permalink
Print only filename without full path in unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
gajanan-choudhary committed Aug 9, 2020
1 parent 75e807f commit abcb206
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/debugmacro.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#pragma once
#include <string.h>

#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)

#ifdef _DEBUG
#define DEBUG_MSG(str) \
do { std::cerr \
<< __FILE__ <<":" << __LINE__ << ":" << __func__ << "(): " \
<< __FILENAME__ <<":" << __LINE__ << ":" << __func__ << "(): " \
<< str << std::endl; } while( false )
#else
#define DEBUG_MSG(str) do { } while ( false )
Expand Down

0 comments on commit abcb206

Please sign in to comment.