Files
Sam Protsenko d70d919c01 Add original Samsung hardware projects
Change-Id: I79380bc91acf57ca5f3e56fb64af76f4c45f6566
Signed-off-by: Sam Protsenko <joe.skb7@gmail.com>
2023-09-09 08:33:16 +02:00

87 lines
2.3 KiB
C

/*
*
* Copyright 2012 Samsung Electronics S.LSI Co. LTD
*
* 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.
*/
/*
* @file Exynos_OSAL_Log.h
* @brief
* @author Yunji Kim (yunji.kim@samsung.com)
* @version 2.0.0
* @history
* 2012.02.20 : Create
* 2012.8.27 : Add trace function
*/
#ifndef EXYNOS_OSAL_LOG
#define EXYNOS_OSAL_LOG
#ifdef __cplusplus
extern "C" {
#endif
#ifndef EXYNOS_LOG_OFF
#define EXYNOS_LOG
#endif
#ifndef EXYNOS_LOG_TAG
#define EXYNOS_LOG_TAG "EXYNOS_LOG"
#endif
#define EXYNOS_TRACE_FUNCTION_INFO
#ifndef USE_ANDROID
#define PROPERTY_KEY_MAX 32
#define PROPERTY_VALUE_MAX 92
#endif
typedef enum _LOG_LEVEL
{
EXYNOS_LOG_FUNC_TRACE,
EXYNOS_LOG_TRACE,
EXYNOS_LOG_ESSENTIAL,
EXYNOS_LOG_INFO,
EXYNOS_LOG_WARNING,
EXYNOS_LOG_ERROR
} EXYNOS_LOG_LEVEL;
#ifdef EXYNOS_LOG
#define Exynos_OSAL_Log(a, ...) ((void)_Exynos_OSAL_Log(a, EXYNOS_LOG_TAG, __VA_ARGS__))
#else
#define Exynos_OSAL_Log(a, ...) \
do { \
if ((a == EXYNOS_LOG_ERROR) || \
(a == EXYNOS_LOG_WARNING)) \
((void)_Exynos_OSAL_Log(a, EXYNOS_LOG_TAG, __VA_ARGS__)); \
} while (0)
#endif
#ifdef EXYNOS_TRACE_FUNCTION_INFO
#define FunctionIn() _Exynos_OSAL_Log(EXYNOS_LOG_FUNC_TRACE, EXYNOS_LOG_TAG, "%s In , Line: %d", __FUNCTION__, __LINE__)
#define FunctionOut() _Exynos_OSAL_Log(EXYNOS_LOG_FUNC_TRACE, EXYNOS_LOG_TAG, "%s Out , Line: %d", __FUNCTION__, __LINE__)
#else
#define FunctionIn() ((void *)0)
#define FunctionOut() ((void *)0)
#endif
void Exynos_OSAL_Get_Log_Property();
void _Exynos_OSAL_Log(EXYNOS_LOG_LEVEL logLevel, const char *tag, const char *msg, ...);
#ifdef __cplusplus
}
#endif
#endif