Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: native_client_sdk/src/libraries/nacl_io/log.h

Issue 349703003: [NaCl SDK] Add some more logging to nacl_io. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux host build Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_io/log.h
diff --git a/native_client_sdk/src/libraries/nacl_io/log.h b/native_client_sdk/src/libraries/nacl_io/log.h
index 8c9ce8d28cb059cba1c9e1483389d8f0fb4817d9..beffe1b0372af865014b15f57204417f003b955d 100644
--- a/native_client_sdk/src/libraries/nacl_io/log.h
+++ b/native_client_sdk/src/libraries/nacl_io/log.h
@@ -9,18 +9,38 @@
#define LOG_PREFIX "nacl_io: "
+#if defined(NDEBUG)
+
+#define LOG_TRACE(format, ...)
+#define LOG_ERROR(format, ...)
+#define LOG_WARN(format, ...)
+
+#else
+
#if NACL_IO_LOGGING
+
#define LOG_TRACE(format, ...) \
nacl_io_log(LOG_PREFIX format "\n", ##__VA_ARGS__)
+
#else
+
#define LOG_TRACE(format, ...)
+
#endif
-#define LOG_ERROR(format, ...) \
- nacl_io_log(LOG_PREFIX "error: " format "\n", ##__VA_ARGS__)
+#define LOG_ERROR(format, ...) \
+ nacl_io_log(LOG_PREFIX "%s:%d: error: " format "\n", \
+ __FILE__, \
+ __LINE__, \
+ ##__VA_ARGS__)
-#define LOG_WARN(format, ...) \
- nacl_io_log(LOG_PREFIX "warning: " format "\n", ##__VA_ARGS__)
+#define LOG_WARN(format, ...) \
+ nacl_io_log(LOG_PREFIX "%s:%d: warning: " format "\n", \
+ __FILE__, \
+ __LINE__, \
+ ##__VA_ARGS__)
+
+#endif
EXTERN_C_BEGIN
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc ('k') | native_client_sdk/src/libraries/nacl_io/socket/tcp_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698