codeworkx | f1be2fe | 2012-03-24 17:38:29 +0100 | [diff] [blame] | 1 | /* |
codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 2 | * Copyright (C) 2010 The Android Open Source Project |
codeworkx | f1be2fe | 2012-03-24 17:38:29 +0100 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* |
codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 18 | * |
| 19 | * @author Rama, Meka(v.meka@samsung.com) |
| 20 | Sangwoo, Park(sw5771.park@samsung.com) |
| 21 | Jamie Oh (jung-min.oh@samsung.com) |
| 22 | * @date 2011-03-11 |
| 23 | * |
codeworkx | f1be2fe | 2012-03-24 17:38:29 +0100 | [diff] [blame] | 24 | */ |
| 25 | |
| 26 | #include <utils/Log.h> |
| 27 | |
codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 28 | #include "SecHWCUtils.h" |
codeworkx | f1be2fe | 2012-03-24 17:38:29 +0100 | [diff] [blame] | 29 | |
codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 30 | void _SEC_HWC_Log(HWC_LOG_LEVEL logLevel, const char *tag, const char *msg, ...) |
codeworkx | f1be2fe | 2012-03-24 17:38:29 +0100 | [diff] [blame] | 31 | { |
| 32 | va_list argptr; |
| 33 | |
| 34 | va_start(argptr, msg); |
| 35 | |
| 36 | switch (logLevel) { |
codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 37 | case HWC_LOG_DEBUG: |
codeworkx | f1be2fe | 2012-03-24 17:38:29 +0100 | [diff] [blame] | 38 | __android_log_vprint(ANDROID_LOG_DEBUG, tag, msg, argptr); |
| 39 | break; |
codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 40 | case HWC_LOG_WARNING: |
codeworkx | f1be2fe | 2012-03-24 17:38:29 +0100 | [diff] [blame] | 41 | __android_log_vprint(ANDROID_LOG_WARN, tag, msg, argptr); |
| 42 | break; |
codeworkx | 62f02ba | 2012-05-20 12:00:36 +0200 | [diff] [blame] | 43 | case HWC_LOG_ERROR: |
codeworkx | f1be2fe | 2012-03-24 17:38:29 +0100 | [diff] [blame] | 44 | __android_log_vprint(ANDROID_LOG_ERROR, tag, msg, argptr); |
| 45 | break; |
| 46 | default: |
| 47 | __android_log_vprint(ANDROID_LOG_VERBOSE, tag, msg, argptr); |
| 48 | } |
| 49 | |
| 50 | va_end(argptr); |
| 51 | } |