ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / native_client_sdk / src / libraries / nacl_io / log.h
blobbeffe1b0372af865014b15f57204417f003b955d
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. */
5 #ifndef LIBRARIES_NACL_IO_LOG_H_
6 #define LIBRARIES_NACL_IO_LOG_H_
8 #include "sdk_util/macros.h"
10 #define LOG_PREFIX "nacl_io: "
12 #if defined(NDEBUG)
14 #define LOG_TRACE(format, ...)
15 #define LOG_ERROR(format, ...)
16 #define LOG_WARN(format, ...)
18 #else
20 #if NACL_IO_LOGGING
22 #define LOG_TRACE(format, ...) \
23 nacl_io_log(LOG_PREFIX format "\n", ##__VA_ARGS__)
25 #else
27 #define LOG_TRACE(format, ...)
29 #endif
31 #define LOG_ERROR(format, ...) \
32 nacl_io_log(LOG_PREFIX "%s:%d: error: " format "\n", \
33 __FILE__, \
34 __LINE__, \
35 ##__VA_ARGS__)
37 #define LOG_WARN(format, ...) \
38 nacl_io_log(LOG_PREFIX "%s:%d: warning: " format "\n", \
39 __FILE__, \
40 __LINE__, \
41 ##__VA_ARGS__)
43 #endif
45 EXTERN_C_BEGIN
48 * Low level logging function for nacl_io log messages.
50 * This function sends its output directly to the IRT standard out
51 * file descriptor, which by default will apear on the standard out
52 * or chrome or sel_ldr.
54 void nacl_io_log(const char* format, ...) PRINTF_LIKE(1, 2);
56 EXTERN_C_END
58 #endif /* LIBRARIES_NACL_IO_LOG_H_ */