blob: 2e6b47f7de71befd3f81e8ff56efa62aa2976172 [file] [log] [blame]
Tom Cherry349b0c42020-01-08 14:47:42 -08001/*
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
23namespace android {
24namespace base {
25
26struct LibLogFunctions {
27 void (*__android_log_set_logger)(__android_logger_function logger);
Tom Cherryebf43ad2020-03-11 11:07:13 -070028 void (*__android_log_write_log_message)(struct __android_log_message* log_message);
Tom Cherry349b0c42020-01-08 14:47:42 -080029
Tom Cherryebf43ad2020-03-11 11:07:13 -070030 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);
Tom Cherry349b0c42020-01-08 14:47:42 -080032
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);
Tom Cherryf1a975b2020-03-12 11:07:07 -070036 int32_t (*__android_log_set_minimum_priority)(int32_t priority);
37 int32_t (*__android_log_get_minimum_priority)();
Tom Cherry69ee5dd2020-01-22 07:48:42 -080038 void (*__android_log_set_default_tag)(const char* tag);
Tom Cherry349b0c42020-01-08 14:47:42 -080039};
40
41const std::optional<LibLogFunctions>& GetLibLogFunctions();
42
43} // namespace base
44} // namespace android