3 * Copyright 2012 Samsung Electronics S.LSI Co. LTD
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file Exynos_OSAL_Log.c
21 * @author Yunji Kim (yunji.kim@samsung.com)
26 #ifndef SLP_PLATFORM /* build env */
27 #include <utils/Log.h>
31 #define DLOG_TAG "OMX_LOG"
37 #include "Exynos_OSAL_Log.h"
39 #ifdef SLP_PLATFORM /* build env */
40 static int component_debug_level = -1;
43 void _Exynos_OSAL_Log(EXYNOS_LOG_LEVEL logLevel, const char *tag, const char *msg, ...)
48 va_start(argptr, msg);
51 case EXYNOS_LOG_TRACE:
52 __android_log_vprint(ANDROID_LOG_DEBUG, tag, msg, argptr);
55 __android_log_vprint(ANDROID_LOG_INFO, tag, msg, argptr);
57 case EXYNOS_LOG_WARNING:
58 __android_log_vprint(ANDROID_LOG_WARN, tag, msg, argptr);
60 case EXYNOS_LOG_ERROR:
61 __android_log_vprint(ANDROID_LOG_ERROR, tag, msg, argptr);
64 __android_log_vprint(ANDROID_LOG_VERBOSE, tag, msg, argptr);
72 if (component_debug_level < 0) {
73 component_debug_level = getenv("OMX_DEBUG") ? atoi(getenv("OMX_DEBUG")) : OMX_DEBUG_LEVEL;
75 if ((int)logLevel < component_debug_level) return;
78 va_start(argptr, msg);
81 case EXYNOS_LOG_VERVOSE:
82 case EXYNOS_LOG_TRACE:
83 SLOG_VA (LOG_DEBUG, DLOG_TAG, msg, argptr);
86 SLOG_VA (LOG_INFO, DLOG_TAG, msg, argptr);
88 case EXYNOS_LOG_WARNING:
89 SLOG_VA (LOG_WARN, DLOG_TAG, msg, argptr);
91 case EXYNOS_LOG_ERROR:
92 SLOG_VA (LOG_ERROR, DLOG_TAG, msg, argptr);
95 SLOG_VA (LOG_DEBUG, DLOG_TAG, msg, argptr);
103 if (component_debug_level < 0) {
104 component_debug_level = getenv("OMX_DEBUG") ? atoi(getenv("OMX_DEBUG")) : OMX_DEBUG_LEVEL;
106 if ((int)logLevel < component_debug_level) return;
109 va_start(argptr, msg);
110 vprintf(msg, argptr);