feat: 日志增强功能
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
#include <pthread.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
@@ -31,6 +32,15 @@
|
||||
typedef struct omni_file_logger {
|
||||
FILE *file;
|
||||
pthread_mutex_t mutex;
|
||||
char path[PATH_MAX];
|
||||
size_t current_bytes;
|
||||
size_t buffered_bytes;
|
||||
size_t flush_bytes;
|
||||
size_t max_bytes;
|
||||
int flush_interval_ms;
|
||||
int max_files;
|
||||
int immediate_flush;
|
||||
uint64_t last_flush_monotonic_ms;
|
||||
} omni_file_logger_t;
|
||||
|
||||
int64_t omni_now_unix_nano(void);
|
||||
@@ -61,6 +71,7 @@ double omni_duration_ms_to_ns(double ms);
|
||||
const char *omni_path_base_name(const char *path);
|
||||
|
||||
void omni_file_logger_init(omni_file_logger_t *logger, FILE *file);
|
||||
void omni_file_logger_init_path(omni_file_logger_t *logger, FILE *file, const char *path, int immediate_flush);
|
||||
void omni_file_logger_destroy(omni_file_logger_t *logger);
|
||||
int omni_file_logger_write_line(omni_file_logger_t *logger, const char *line);
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ typedef struct video_pipeline_config {
|
||||
int hard_backpressure_hold_ms;
|
||||
int server_idle_reconnect_ms;
|
||||
int frame_stall_reconnect_ms;
|
||||
kcp_session_stats_logger_t *stats_logger;
|
||||
int stats_interval_ms;
|
||||
video_pipeline_progress_fn progress_callback;
|
||||
void *progress_context;
|
||||
} video_pipeline_config_t;
|
||||
|
||||
Reference in New Issue
Block a user