add SG_ORIGIN macro that expands to a string __FILE__":"__LINE__
Note that __LINE__ is a number and can't be directly used in string context, which makes the macro worthwhile. (IMHO :-)
This commit is contained in:
parent
741c4ca15a
commit
a25eebef9b
@ -322,6 +322,9 @@ sglog()
|
|||||||
# define SG_LOG(C,P,M) sglog() << loglevel(C,P) << M << endl
|
# define SG_LOG(C,P,M) sglog() << loglevel(C,P) << M << endl
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define SG_STRINGIFY(x) #x
|
||||||
|
#define SG_TOSTRING(x) SG_STRINGIFY(x)
|
||||||
|
#define SG_ORIGIN __FILE__ ":" SG_TOSTRING(__LINE__)
|
||||||
|
|
||||||
#endif // _LOGSTREAM_H
|
#endif // _LOGSTREAM_H
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user