1# liblog -> logd 2 3The data that liblog sends to logd is represented below. 4 5 struct { 6 android_log_header_t header; 7 union { 8 struct { 9 char prio; 10 char tag[...]; 11 char message[...]; 12 } string; 13 struct { 14 android_event_header_t event_header; 15 android_event_*_t payload[...]; 16 } binary; 17 }; 18 }; 19 20The payload, excluding the header, has a max size of LOGGER_ENTRY_MAX_PAYLOAD. 21 22## header 23 24The header is added immediately before sending the log message to logd. 25 26## `string` payload 27 28The `string` part of the union is for normal buffers (main, system, radio, etc) and consists of a 29single character priority, followed by a variable length null terminated string for the tag, and 30finally a variable length null terminated string for the message. 31 32This payload is used for the `__android_log_buf_write()` family of functions. 33 34## `binary` payload 35 36The `binary` part of the union is for binary buffers (events, security, etc) and consists of an 37android_event_header_t struct followed by a variable number of android_event_*_t 38(android_event_list_t, android_event_int_t, etc) structs. 39 40If multiple android_event_*_t elements are present, then they must be in a list and the first 41element in payload must be an android_event_list_t. 42 43This payload is used for the `__android_log_bwrite()` family of functions. It is additionally used 44for `android_log_write_list()` and the related functions that manipulate event lists. 45 46# logd -> liblog 47 48logd sends a `logger_entry` struct to liblog followed by the payload. The payload is identical to 49the payloads defined above. The max size of the entire message from logd is LOGGER_ENTRY_MAX_LEN. 50