Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / native_client_sdk / src / libraries / nacl_io / log.h
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. */
4
5 #ifndef LIBRARIES_NACL_IO_LOG_H_
6 #define LIBRARIES_NACL_IO_LOG_H_
7
8 #include "sdk_util/macros.h"
9
10 #define LOG_PREFIX "nacl_io: "
11
12 #if defined(NACL_IO_LOGGING)
13 #define LOG_TRACE(format, ...) \
14   nacl_io_log(LOG_PREFIX format "\n", ##__VA_ARGS__)
15 #else
16 #define LOG_TRACE(format, ...)
17 #endif
18
19 #define LOG_ERROR(format, ...) \
20   nacl_io_log(LOG_PREFIX "error: " format "\n", ##__VA_ARGS__)
21
22 EXTERN_C_BEGIN
23
24 /*
25  * Low level logging function for nacl_io log messages.
26  *
27  * This function sends its output directly to the IRT standard out
28  * file descriptor, which by default will apear on the standard out
29  * or chrome or sel_ldr.
30  */
31 void nacl_io_log(const char* format, ...) PRINTF_LIKE(1, 2);
32
33 EXTERN_C_END
34
35 #endif  /* LIBRARIES_NACL_IO_LOG_H_ */