123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #include <keymaster/soft_keymaster_logger.h>
- #include <stdarg.h>
- #include <syslog.h>
- #define LOG_TAG "SoftKeymaster"
- #include <log/log.h>
- namespace keymaster {
- int SoftKeymasterLogger::log_msg(LogLevel level, const char* fmt, va_list args) const {
- int android_log_level = ANDROID_LOG_ERROR;
- switch (level) {
- case DEBUG_LVL:
- android_log_level = ANDROID_LOG_DEBUG;
- break;
- case INFO_LVL:
- android_log_level = ANDROID_LOG_INFO;
- break;
- case WARNING_LVL:
- android_log_level = ANDROID_LOG_WARN;
- break;
- case ERROR_LVL:
- android_log_level = ANDROID_LOG_ERROR;
- break;
- case SEVERE_LVL:
- android_log_level = ANDROID_LOG_ERROR;
- break;
- }
- return LOG_PRI_VA(android_log_level, LOG_TAG, fmt, args);
- }
- }
|