#include "ulog.h"
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
Go to the source code of this file.
◆ __attribute__()
__attribute__ |
( |
(format(printf, 2, 0)) |
| ) |
|
Definition at line 91 of file ulog.c.
96 if ((kmsg = fopen(
"/dev/kmsg",
"r+")) != NULL) {
97 fprintf(kmsg,
"<%u>", priority);
102 vfprintf(kmsg, fmt, ap);
FILE(GLOB test_cases "test-*.c") MACRO(ADD_FUZZER_TEST name) ADD_EXECUTABLE($
static const char * _ulog_ident
◆ ulog()
void ulog |
( |
int |
priority, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Definition at line 154 of file ulog.c.
174 ulog_kmsg(priority, fmt, ap);
181 ulog_stdio(priority, fmt, ap);
188 ulog_syslog(priority, fmt, ap);
void udebug_entry_add(struct udebug_buf *buf)
int udebug_entry_vprintf(struct udebug_buf *buf, const char *fmt, va_list ap)
static void udebug_entry_init(struct udebug_buf *buf)
static struct udebug_buf * udb
static int _ulog_threshold
static int _ulog_channels
static void ulog_defaults(void)
◆ ulog_close()
Definition at line 138 of file ulog.c.
static int _ulog_initialized
◆ ulog_default_ident()
static const char* ulog_default_ident |
( |
void |
| ) |
|
|
static |
Definition at line 34 of file ulog.c.
41 if ((
self = fopen(
"/proc/self/status",
"r")) != NULL) {
42 while (fgets(line,
sizeof(line),
self)) {
43 if (!strncmp(line,
"Name:", 5)) {
44 strtok_r(line,
"\t\n", &sbuf);
45 p = strtok_r(NULL,
"\t\n", &sbuf);
◆ ulog_defaults()
static void ulog_defaults |
( |
void |
| ) |
|
|
static |
Definition at line 55 of file ulog.c.
62 env = getenv(
"PREINIT");
65 if (env && !strcmp(env,
"1"))
74 if (env && !strcmp(env,
"1"))
static const char * ulog_default_ident(void)
static int _ulog_facility
◆ ulog_open()
void ulog_open |
( |
int |
channels, |
|
|
int |
facility, |
|
|
const char * |
ident |
|
) |
| |
◆ ulog_threshold()
void ulog_threshold |
( |
int |
threshold | ) |
|
◆ ulog_udebug()
◆ _ulog_channels
◆ _ulog_facility
◆ _ulog_ident
const char* _ulog_ident = NULL |
|
static |
◆ _ulog_initialized
int _ulog_initialized = 0 |
|
static |
◆ _ulog_threshold
int _ulog_threshold = LOG_DEBUG |
|
static |
◆ udb