Shawn Willden | 2079ae8 | 2015-01-22 13:42:31 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2015 The Android Open Source Project |
| 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 | #include "soft_keymaster_logger.h" |
| 18 | |
| 19 | #include <stdarg.h> |
| 20 | #include <syslog.h> |
| 21 | |
| 22 | #define LOG_TAG "SoftKeymaster" |
| 23 | #include <cutils/log.h> |
| 24 | |
| 25 | namespace keymaster { |
| 26 | |
| 27 | int SoftKeymasterLogger::debug(const char* fmt, ...) const { |
| 28 | va_list args; |
| 29 | va_start(args, fmt); |
| 30 | int retval = LOG_PRI_VA(LOG_DEBUG, LOG_TAG, fmt, args); |
| 31 | va_end(args); |
| 32 | return retval; |
| 33 | } |
| 34 | |
| 35 | int SoftKeymasterLogger::info(const char* fmt, ...) const { |
| 36 | va_list args; |
| 37 | va_start(args, fmt); |
| 38 | int retval = LOG_PRI_VA(LOG_INFO, LOG_TAG, fmt, args); |
| 39 | va_end(args); |
| 40 | return retval; |
| 41 | } |
| 42 | |
| 43 | int SoftKeymasterLogger::error(const char* fmt, ...) const { |
| 44 | va_list args; |
| 45 | va_start(args, fmt); |
| 46 | int retval = LOG_PRI_VA(LOG_ERR, LOG_TAG, fmt, args); |
| 47 | va_end(args); |
| 48 | return retval; |
| 49 | } |
| 50 | |
| 51 | int SoftKeymasterLogger::severe(const char* fmt, ...) const { |
| 52 | va_list args; |
| 53 | va_start(args, fmt); |
| 54 | int retval = LOG_PRI_VA(LOG_CRIT, LOG_TAG, fmt, args); |
| 55 | va_end(args); |
| 56 | return retval; |
| 57 | } |
| 58 | |
| 59 | } // namespace keymaster |