File.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_SRC_LOG_FILE_H
10#define SQUID_SRC_LOG_FILE_H
11
12#include "cbdata.h"
13#include "dlink.h"
14
15#if HAVE_SYS_PARAM_H
16#include <sys/param.h>
17#endif
18
20{
21public:
22 char *buf;
23 int size;
24 int len;
27};
28
29class Logfile;
30
31typedef void LOGLINESTART(Logfile *);
32typedef void LOGWRITE(Logfile *, const char *, size_t len);
33typedef void LOGLINEEND(Logfile *);
34typedef void LOGFLUSH(Logfile *);
35typedef void LOGROTATE(Logfile *, const int16_t);
36typedef void LOGCLOSE(Logfile *);
37
39{
41
42public:
43 explicit Logfile(const char *aPath);
45
47
48 struct {
49 unsigned int fatal;
51
53
54public:
55 void *data;
56
63};
64
65/* Legacy API */
66Logfile *logfileOpen(const char *path, size_t bufsz, int);
67void logfileClose(Logfile * lf);
68void logfileRotate(Logfile * lf, int16_t rotateCount);
69void logfileWrite(Logfile * lf, const char *buf, size_t len);
70void logfileFlush(Logfile * lf);
71void logfilePrintf(Logfile * lf, const char *fmt,...) PRINTF_FORMAT_ARG2;
72void logfileLineStart(Logfile * lf);
73void logfileLineEnd(Logfile * lf);
74
75#endif /* SQUID_SRC_LOG_FILE_H */
76
Definition: File.h:39
LOGLINEEND * f_lineend
Definition: File.h:59
LOGFLUSH * f_flush
Definition: File.h:60
int64_t sequence_number
Unique sequence number per log line.
Definition: File.h:52
void * data
Definition: File.h:55
LOGCLOSE * f_close
Definition: File.h:62
char path[MAXPATHLEN]
Definition: File.h:46
CBDATA_CLASS(Logfile)
struct Logfile::@79 flags
~Logfile()
Definition: File.h:44
LOGLINESTART * f_linestart
Definition: File.h:57
LOGWRITE * f_linewrite
Definition: File.h:58
unsigned int fatal
Definition: File.h:49
Logfile(const char *aPath)
Definition: File.cc:25
LOGROTATE * f_rotate
Definition: File.h:61
int written_len
Definition: File.h:25
dlink_node node
Definition: File.h:26
char * buf
Definition: File.h:22
#define PRINTF_FORMAT_ARG2
void LOGROTATE(Logfile *, const int16_t)
Definition: File.h:35
void logfileLineEnd(Logfile *lf)
Definition: File.cc:132
void logfileWrite(Logfile *lf, const char *buf, size_t len)
Definition: File.cc:108
void LOGLINESTART(Logfile *)
Definition: File.h:31
void logfileFlush(Logfile *lf)
Definition: File.cc:139
Logfile * logfileOpen(const char *path, size_t bufsz, int)
Definition: File.cc:40
void logfilePrintf(Logfile *lf, const char *fmt,...) PRINTF_FORMAT_ARG2
Definition: File.cc:114
void LOGCLOSE(Logfile *)
Definition: File.h:36
void LOGLINEEND(Logfile *)
Definition: File.h:33
void LOGWRITE(Logfile *, const char *, size_t len)
Definition: File.h:32
void logfileRotate(Logfile *lf, int16_t rotateCount)
Definition: File.cc:101
void logfileLineStart(Logfile *lf)
Definition: File.cc:126
void logfileClose(Logfile *lf)
Definition: File.cc:92
void LOGFLUSH(Logfile *)
Definition: File.h:34
#define MAXPATHLEN
Definition: stdio.h:62

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors