Make newline part of log macros so that caller doesn't have to append '\n' every time logs are used. This make sure that no log will be missing new line which results in concatenated log messages. Change-Id: I3231ae747c790816dbc1608e0a3bd56467ba0a1b Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
43 lines
1.4 KiB
C
43 lines
1.4 KiB
C
/** @file
|
|
* @brief Bluetooth subsystem logging helpers.
|
|
*/
|
|
|
|
/*
|
|
* Copyright (c) 2015 Intel Corporation
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
#ifndef __BT_LOG_H
|
|
#define __BT_LOG_H
|
|
|
|
#include <stdio.h>
|
|
|
|
#if defined(CONFIG_BLUETOOTH_DEBUG)
|
|
#define BT_DBG(fmt, ...) printf("bt: %s (%p): " fmt "\n", __func__, \
|
|
sys_thread_self_get(), ##__VA_ARGS__)
|
|
#define BT_ERR(fmt, ...) printf("bt: %s: " fmt "\n", __func__, ##__VA_ARGS__)
|
|
#define BT_WARN(fmt, ...) printf("bt: %s: " fmt "\n", __func__, ##__VA_ARGS__)
|
|
#define BT_INFO(fmt, ...) printf("bt: " fmt "\n", ##__VA_ARGS__)
|
|
#define BT_ASSERT(cond) if (!(cond)) { \
|
|
BT_ERR("bt: assert: '" #cond "' failed"); \
|
|
}
|
|
#else
|
|
#define BT_DBG(fmt, ...)
|
|
#define BT_ERR(fmt, ...)
|
|
#define BT_WARN(fmt, ...)
|
|
#define BT_INFO(fmt, ...)
|
|
#define BT_ASSERT(cond)
|
|
#endif /* CONFIG_BLUETOOTH_DEBUG */
|
|
|
|
#endif /* __BT_LOG_H */
|