const bool VERBOSE = true;
#endif
+#define LOCATION_LINE(x) #x
+#define LOCATION(line) __FILE__ ":" LOCATION_LINE(line)
+
#define LOG(msg, ...) do { \
if (VERBOSE) { \
- printf(msg " [%s:%d]\n", ##__VA_ARGS__, __FILE__, __LINE__); \
+ printf("[" LOCATION(__LINE__) "] " msg "\n", ##__VA_ARGS__); \
} \
} while(0)
-#define ERROR(msg, ...) fprintf(stderr, msg " [%s:%d]\n", ##__VA_ARGS__, __FILE__, __LINE__)
+#define ERROR(msg, ...) fprintf(stderr, "[" LOCATION(__LINE__) "] " msg "\n", ##__VA_ARGS__)
class ScopedIOHIDManager {
public: