Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd01164a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Make log_event_list.h available to vendor code."

parents d31df3a1 446d01c2
Loading
Loading
Loading
Loading
+73 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2005-2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* Special log_event_list.h file for VNDK linking modules */

#ifndef _LIBS_LOG_EVENT_LIST_H
#define _LIBS_LOG_EVENT_LIST_H

#include <stdint.h>

#include <log/log_id.h>

#ifdef __cplusplus
extern "C" {
#endif

#define __ANDROID_USE_LIBLOG_EVENT_INTERFACE 1

/*
 * The opaque context used to manipulate lists of events.
 */
#ifndef __android_log_context_defined
#define __android_log_context_defined
typedef struct android_log_context_internal* android_log_context;
#endif

/*
 * Creates a context associated with an event tag to write elements to
 * the list of events.
 */
android_log_context create_android_logger(uint32_t tag);

/* All lists must be braced by a begin and end call */
/*
 * NB: If the first level braces are missing when specifying multiple
 *     elements, we will manufacturer a list to embrace it for your API
 *     convenience. For a single element, it will remain solitary.
 */
int android_log_write_list_begin(android_log_context ctx);
int android_log_write_list_end(android_log_context ctx);

int android_log_write_int32(android_log_context ctx, int32_t value);
int android_log_write_int64(android_log_context ctx, int64_t value);
int android_log_write_string8(android_log_context ctx, const char* value);
int android_log_write_string8_len(android_log_context ctx, const char* value,
                                  size_t maxlen);
int android_log_write_float32(android_log_context ctx, float value);

/* Submit the composed list context to the specified logger id */
/* NB: LOG_ID_EVENTS and LOG_ID_SECURITY only valid binary buffers */
int android_log_write_list(android_log_context ctx, log_id_t id);

/* Finished with reader or writer context */
int android_log_destroy(android_log_context* ctx);

#ifdef __cplusplus
}
#endif

#endif /* _LIBS_LOG_EVENT_LIST_H */
+11 −0
Original line number Diff line number Diff line
@@ -35,6 +35,17 @@ LIBLOG_M {
    android_logger_get_statistics; # vndk
    __android_log_error_write; # vndk
    __android_log_is_loggable;
    create_android_logger; #vndk
    android_log_destroy; #vndk
    android_log_write_list_begin; #vndk
    android_log_write_list_end; #vndk
    android_log_write_int32; #vndk
    android_log_write_int64; #vndk
    android_log_write_string8; #vndk
    android_log_write_string8_len; #vndk
    android_log_write_float32; #vndk
    android_log_write_list; #vndk

};

LIBLOG_O {