dlog
Logging framework
 All Files Functions Typedefs Enumerations Enumerator Groups Pages
dlogutil.h
Go to the documentation of this file.
1 /*
2  * DLOG
3  * Copyright (c) 2005-2008, The Android Open Source Project
4  * Copyright (c) 2012-2020 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the License);
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef __TIZEN_SYSTEM_DLOGUTIL_H__
20 #define __TIZEN_SYSTEM_DLOGUTIL_H__
21 
22 #include <time.h>
23 #include <tizen_type.h>
24 #include <dlog.h>
25 #include <limits.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
41 typedef enum {
49 
56 typedef enum {
57  DLOGUTIL_BUF_MAIN = 1 << LOG_ID_MAIN,
58  DLOGUTIL_BUF_RADIO = 1 << LOG_ID_RADIO,
59  DLOGUTIL_BUF_SYSTEM = 1 << LOG_ID_SYSTEM,
60  DLOGUTIL_BUF_APPS = 1 << LOG_ID_APPS,
61  DLOGUTIL_BUF_KMSG = 1 << LOG_ID_KMSG,
62  DLOGUTIL_BUF_SYSLOG = 1 << LOG_ID_SYSLOG,
64 
69 typedef struct dlogutil_entry dlogutil_entry_s;
70 
83 int dlogutil_entry_get_tid(const dlogutil_entry_s *entry, pid_t *tid);
84 
97 int dlogutil_entry_get_pid(const dlogutil_entry_s *entry, pid_t *pid);
98 
112 int dlogutil_entry_get_tag(const dlogutil_entry_s *entry, const char **tag);
113 
127 int dlogutil_entry_get_message(const dlogutil_entry_s *entry, const char **msg);
128 
144 int dlogutil_entry_get_timestamp(const dlogutil_entry_s *entry, dlogutil_sorting_order_e order, struct timespec *ts);
145 
157 
162 typedef struct dlogutil_filter_options dlogutil_filter_options_s;
163 
172 
180 
192 
204 
217 
222 typedef struct dlogutil_sorting_options dlogutil_sorting_options_s;
223 
232 
240 
252 
265 
282 
298 
310 typedef int dlogutil_entry_cb(const dlogutil_entry_s *entry, void *data);
311 
317 #define DLOGUTIL_MAX_DUMP_SIZE UINT_MAX
318 
378 int dlogutil_get_logs_continuous(int buffers, dlogutil_entry_cb callback, void *data, dlogutil_sorting_options_s *sorting, dlogutil_filter_options_s *filter);
379 
439 int dlogutil_get_logs_monitor(int buffers, dlogutil_entry_cb callback, void *data, dlogutil_sorting_options_s *sorting, dlogutil_filter_options_s *filter);
440 
504 int dlogutil_get_logs_dump(int buffers, unsigned int entry_count, dlogutil_entry_cb callback, void *data, dlogutil_sorting_options_s *sorting, dlogutil_filter_options_s *filter);
505 
518 
533 int dlogutil_buffer_get_name(dlogutil_buffer_e buffer, const char **name);
534 
552 int dlogutil_buffer_get_size(dlogutil_buffer_e buffer, unsigned int *size);
553 
575 
597 
602 #ifdef __cplusplus
603 }
604 #endif
605 
606 #endif /* __TIZEN_SYSTEM_DLOGUTIL_H__ */