blob: c68fff6803b63c19041922b1cde30a826e8c5b23 [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);
28 void (*__android_log_write_logger_data)(struct __android_logger_data* logger_data,
29 const char* msg);
30
31 void (*__android_log_logd_logger)(const struct __android_logger_data* logger_data,
32 const char* msg);
33 void (*__android_log_stderr_logger)(const struct __android_logger_data* logger_data,
34 const char* message);
35
36 void (*__android_log_set_aborter)(__android_aborter_function aborter);
37 void (*__android_log_call_aborter)(const char* abort_message);
38 void (*__android_log_default_aborter)(const char* abort_message);
Tom Cherry0391a872020-01-16 15:58:02 -080039 int (*__android_log_set_minimum_priority)(int priority);
40 int (*__android_log_get_minimum_priority)();
Tom Cherry349b0c42020-01-08 14:47:42 -080041};
42
43const std::optional<LibLogFunctions>& GetLibLogFunctions();
44
45} // namespace base
46} // namespace android