1 /*
2  * Copyright (C) 2020 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 #pragma once
18 
19 #include <optional>
20 
21 #include <android/log.h>
22 
23 namespace android {
24 namespace base {
25 
26 struct LibLogFunctions {
27   void (*__android_log_set_logger)(__android_logger_function logger);
28   void (*__android_log_write_log_message)(struct __android_log_message* log_message);
29 
30   void (*__android_log_logd_logger)(const struct __android_log_message* log_message);
31   void (*__android_log_stderr_logger)(const struct __android_log_message* log_message);
32 
33   void (*__android_log_set_aborter)(__android_aborter_function aborter);
34   void (*__android_log_call_aborter)(const char* abort_message);
35   void (*__android_log_default_aborter)(const char* abort_message);
36   int32_t (*__android_log_set_minimum_priority)(int32_t priority);
37   int32_t (*__android_log_get_minimum_priority)();
38   void (*__android_log_set_default_tag)(const char* tag);
39 };
40 
41 const std::optional<LibLogFunctions>& GetLibLogFunctions();
42 
43 }  // namespace base
44 }  // namespace android
45