libosmocore 1.12.0.59-e9cb.202601311800
Osmocom core library
Loading...
Searching...
No Matches
logging_file.c File Reference

File & stderr logging support code. More...

#include "config.h"
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/select.h>
#include <osmocom/core/write_queue.h>
#include <osmocom/core/logging_internal.h>

Macros

#define LOG_WQUEUE_LEN   156
 

Functions

int log_target_file_reopen (struct log_target *target)
 close and re-open a log file (for log file rotation)
 
void log_target_file_destroy (struct log_target *target)
 
static int _file_wq_write_cb (struct osmo_fd *ofd, struct msgb *msg)
 
static void _file_output_stream (struct log_target *target, unsigned int level, const char *log)
 
static void _file_raw_output (struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
 
int log_target_file_switch_to_stream (struct log_target *target)
 switch from non-blocking/write-queue to blocking + buffered stream output
 
int log_target_file_switch_to_wqueue (struct log_target *target)
 switch from blocking + buffered file output to non-blocking write-queue based output.
 
struct log_target * log_target_create_file (const char *fname)
 Create a new file-based log target using non-blocking write_queue.
 
struct log_target * log_target_create_stderr (void)
 Create the STDERR log target.
 

Detailed Description

File & stderr logging support code.