blob: 065e271639630f2031197f43e64b077f4d0afbea [file] [log] [blame]
The Android Open Source Projecte9df6ba2012-12-13 14:55:37 -08001/******************************************************************************
2 *
3 * Copyright (C) 2012 Broadcom Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18
19/******************************************************************************
20 *
21 * Override the Android logging macro(s) from
22 * /system/core/include/cutils/log.h. This header must be the first header
23 * included by a *.cpp file so the original Android macro can be replaced.
24 * Do not include this header in another header, because that will create
25 * unnecessary dependency.
26 *
27 ******************************************************************************/
28#pragma once
29
Ruchi Kandoi6fca02d2017-01-30 14:28:16 -080030// Override Android's ALOGD macro by adding a boolean expression.
31#define ALOGD(...) \
32 ((void)ALOGD_IF(appl_trace_level >= BT_TRACE_LEVEL_DEBUG, __VA_ARGS__))
The Android Open Source Projecte9df6ba2012-12-13 14:55:37 -080033
Ruchi Kandoi6fca02d2017-01-30 14:28:16 -080034#include <cutils/log.h> //define Android logging macros
Evan Chua24be4f2013-11-13 15:30:16 -050035#include "bt_types.h"
The Android Open Source Projecte9df6ba2012-12-13 14:55:37 -080036
37#ifdef __cplusplus
38extern "C" {
39#endif
Martijn Coenen5c65c3a2013-03-27 13:23:36 -070040
Evan Chua24be4f2013-11-13 15:30:16 -050041extern unsigned char appl_trace_level;
Ruchi Kandoi512ee632017-01-03 13:59:10 -080042extern uint32_t ScrProtocolTraceFlag;
The Android Open Source Projecte9df6ba2012-12-13 14:55:37 -080043
The Android Open Source Projecte9df6ba2012-12-13 14:55:37 -080044/*******************************************************************************
45**
46** Function: initializeGlobalAppLogLevel
47**
48** Description: Initialize and get global logging level from .conf or
49** Android property nfc.app_log_level. The Android property
50** overrides .conf variable.
51**
52** Returns: Global log level:
Ruchi Kandoi552f2b72017-01-28 16:22:55 -080053** BT_TRACE_LEVEL_NONE 0 * No trace messages to be generated
54** BT_TRACE_LEVEL_ERROR 1 * Error condition trace messages
55** BT_TRACE_LEVEL_WARNING 2 * Warning condition trace messages
56** BT_TRACE_LEVEL_API 3 * API traces
57** BT_TRACE_LEVEL_EVENT 4 * Debug messages for events
58** BT_TRACE_LEVEL_DEBUG 5 * Debug messages (general)
The Android Open Source Projecte9df6ba2012-12-13 14:55:37 -080059**
60*******************************************************************************/
Ruchi Kandoi6fca02d2017-01-30 14:28:16 -080061unsigned char initializeGlobalAppLogLevel();
62uint32_t initializeProtocolLogLevel();
Martijn Coenen5c65c3a2013-03-27 13:23:36 -070063
64#ifdef __cplusplus
65}
66#endif