Home | History | Annotate | Download | only in slpi
      1 /*
      2  * Copyright (C) 2017 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 "ash/debug.h"
     18 #include "chre_api/chre/re.h"
     19 #include "chre/util/macros.h"
     20 
     21 DLL_EXPORT void chreLog(enum chreLogLevel level, const char *formatStr, ...) {
     22   enum ashLogLevel ashLevel;
     23   va_list args;
     24 
     25   switch (level) {
     26     case CHRE_LOG_ERROR:
     27       ashLevel = ASH_LOG_ERROR;
     28       break;
     29     case CHRE_LOG_WARN:
     30       ashLevel = ASH_LOG_WARN;
     31       break;
     32     case CHRE_LOG_INFO:
     33       ashLevel = ASH_LOG_INFO;
     34       break;
     35     case CHRE_LOG_DEBUG:
     36     default:
     37       ashLevel = ASH_LOG_DEBUG;
     38   }
     39 
     40   va_start(args, formatStr);
     41   ashVaLog(ASH_SOURCE_CHRE, ashLevel, formatStr, args);
     42   va_end(args);
     43 }
     44