#include <udebug.h>
Go to the source code of this file.
◆ LOG_LINE_SIZE
#define LOG_LINE_SIZE 1024 |
◆ log_list_cb
typedef void(* log_list_cb) (struct log_head *h) |
◆ anonymous enum
Enumerator |
---|
SOURCE_KLOG | |
SOURCE_SYSLOG | |
SOURCE_INTERNAL | |
SOURCE_ANY | |
Definition at line 21 of file syslog.h.
◆ log_add()
void log_add |
( |
char * |
buf, |
|
|
int |
size, |
|
|
int |
source |
|
) |
| |
Definition at line 147 of file syslog.c.
149 regmatch_t matches[3];
157 fprintf(stderr,
"%s", buf);
161 for (c = buf; *c; c++) {
167 while (isspace(*c)) {
175 ret = regexec(&
pat_prio, buf, 3, matches, 0);
177 priority = atoi(&buf[matches[1].rm_so]);
178 size -= matches[2].rm_so;
179 buf += matches[2].rm_so;
191 if ((
priority & LOG_FACMASK) == LOG_LOCAL7)
213 clock_gettime(CLOCK_REALTIME, &
newest->
ts);
void ubus_notify_log(struct log_head *l)
static struct log_head * oldest
static struct log_head * log
static struct log_head * log_next(struct log_head *h, int size)
static void log_add_udebug(int priority, char *buf, int size, int source)
static struct log_head * newest
◆ log_buffer_init()
int log_buffer_init |
( |
int |
size | ) |
|
Definition at line 328 of file syslog.c.
333 fprintf(stderr,
"Failed to initialize log buffer with size %d\n",
log_size);
343 while ((start < end) && l && l->
size) {
struct log_head * log_list(int count, struct log_head *h)
static struct log_head * log_end
◆ log_init()
void log_init |
( |
int |
log_size | ) |
|
◆ log_list()
Definition at line 305 of file syslog.c.
307 unsigned int min = count;
◆ log_shutdown()
void log_shutdown |
( |
void |
| ) |
|
◆ log_udebug_config()
void log_udebug_config |
( |
struct udebug_ubus * |
ctx, |
|
|
struct blob_attr * |
data, |
|
|
bool |
enabled |
|
) |
| |
Definition at line 362 of file syslog.c.
365 udebug_ubus_apply_config(&
ud,
rings, ARRAY_SIZE(
rings), data, enabled);
static struct udebug_ubus_ring rings[]
◆ ubus_notify_log()
void ubus_notify_log |
( |
struct log_head * |
l | ) |
|
Definition at line 208 of file logd.c.
212 if (list_empty(&clients) && !
log_object.has_subscribers)
215 blob_buf_init(&
b, 0);
216 blobmsg_add_string(&
b,
"msg", l->
data);
217 blobmsg_add_u32(&
b,
"id", l->
id);
218 blobmsg_add_u32(&
b,
"priority", l->
priority);
219 blobmsg_add_u32(&
b,
"source", l->
source);
220 blobmsg_add_u64(&
b,
"time", (((__u64) l->
ts.tv_sec) * 1000) + (l->
ts.tv_nsec / 1000000));
225 list_for_each_entry(c, &clients,
list)
226 ustream_write(&c->
s.stream, (
void *)
b.head, blob_len(
b.head) +
sizeof(
struct blob_attr),
false);
static struct ubus_auto_conn conn
static struct ubus_object log_object