php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
zlog.h File Reference
#include <stdarg.h>
#include <sys/types.h>

Go to the source code of this file.

Data Structures

struct  zlog_stream_buffer
 
struct  zlog_stream
 

Macros

#define zlog(flags, ...)
 
#define zlog_msg(flags, prefix, msg)
 
#define ZLOG_TRUE   1
 
#define ZLOG_FALSE   0
 
#define ZLOG_LEVEL_MASK   7
 
#define ZLOG_HAVE_ERRNO   0x100
 
#define ZLOG_SYSERROR   (ZLOG_ERROR | ZLOG_HAVE_ERRNO)
 
#define ZLOG_SYSLOG   -2
 
#define zlog_stream_prefix(stream)
 
#define ZLOG_DEFAULT_LIMIT   1024
 
#define ZLOG_MIN_LIMIT   512
 
#define ZLOG_DEFAULT_BUFFERING   1
 

Typedefs

typedef unsigned char zlog_bool
 

Enumerations

enum  {
  ZLOG_DEBUG = 1 , ZLOG_NOTICE = 2 , ZLOG_WARNING = 3 , ZLOG_ERROR = 4 ,
  ZLOG_ALERT = 5
}
 

Functions

void zlog_set_external_logger (void(*logger)(int, char *, size_t))
 
int zlog_set_fd (int new_fd, zlog_bool is_stderr)
 
int zlog_set_level (int new_value)
 
int zlog_set_limit (int new_value)
 
int zlog_set_buffering (zlog_bool buffering)
 
const char * zlog_get_level_name (int log_level)
 
void zlog_set_launched (void)
 
size_t zlog_print_time (struct timeval *tv, char *timebuf, size_t timebuf_len)
 
void vzlog (const char *function, int line, int flags, const char *fmt, va_list args)
 
void zlog_ex (const char *function, int line, int flags, const char *fmt,...) __attribute__((format(printf
 
void void zlog_msg_ex (const char *function, int line, int flags, const char *prefix, const char *msg)
 
void zlog_stream_init (struct zlog_stream *stream, int flags)
 
void zlog_stream_init_ex (struct zlog_stream *stream, int flags, int fd)
 
void zlog_stream_set_decorating (struct zlog_stream *stream, zlog_bool decorate)
 
void zlog_stream_set_wrapping (struct zlog_stream *stream, zlog_bool wrap)
 
void zlog_stream_set_is_stdout (struct zlog_stream *stream, zlog_bool is_stdout)
 
void zlog_stream_set_child_pid (struct zlog_stream *stream, int child_pid)
 
void zlog_stream_set_msg_quoting (struct zlog_stream *stream, zlog_bool quote)
 
zlog_bool zlog_stream_set_msg_prefix (struct zlog_stream *stream, const char *fmt,...) __attribute__((format(printf
 
zlog_bool zlog_bool zlog_stream_set_msg_suffix (struct zlog_stream *stream, const char *suffix, const char *final_suffix)
 
ssize_t zlog_stream_prefix_ex (struct zlog_stream *stream, const char *function, int line)
 
ssize_t zlog_stream_format (struct zlog_stream *stream, const char *fmt,...) __attribute__((format(printf
 
ssize_t ssize_t zlog_stream_vformat (struct zlog_stream *stream, const char *fmt, va_list args)
 
ssize_t zlog_stream_str (struct zlog_stream *stream, const char *str, size_t str_len)
 
zlog_bool zlog_stream_finish (struct zlog_stream *stream)
 
void zlog_stream_destroy (struct zlog_stream *stream)
 
zlog_bool zlog_stream_close (struct zlog_stream *stream)
 

Macro Definition Documentation

◆ zlog

#define zlog ( flags,
... )
Value:
zlog_ex(__func__, __LINE__, flags, __VA_ARGS__)
void zlog_ex(const char *function, int line, int flags, const char *fmt,...)
Definition zlog.c:259

Definition at line 9 of file zlog.h.

◆ ZLOG_DEFAULT_BUFFERING

#define ZLOG_DEFAULT_BUFFERING   1

Definition at line 120 of file zlog.h.

◆ ZLOG_DEFAULT_LIMIT

#define ZLOG_DEFAULT_LIMIT   1024

Definition at line 116 of file zlog.h.

◆ ZLOG_FALSE

#define ZLOG_FALSE   0

Definition at line 17 of file zlog.h.

◆ ZLOG_HAVE_ERRNO

#define ZLOG_HAVE_ERRNO   0x100

Definition at line 51 of file zlog.h.

◆ ZLOG_LEVEL_MASK

#define ZLOG_LEVEL_MASK   7

Definition at line 49 of file zlog.h.

◆ ZLOG_MIN_LIMIT

#define ZLOG_MIN_LIMIT   512

Definition at line 118 of file zlog.h.

◆ zlog_msg

#define zlog_msg ( flags,
prefix,
msg )
Value:
zlog_msg_ex(__func__, __LINE__, flags, prefix, msg)
#define prefix
char * msg
Definition phpdbg.h:289
void zlog_msg_ex(const char *function, int line, int flags, const char *prefix, const char *msg)
Definition zlog.c:272

Definition at line 10 of file zlog.h.

◆ zlog_stream_prefix

#define zlog_stream_prefix ( stream)
Value:
zlog_stream_prefix_ex(stream, __func__, __LINE__)
ssize_t zlog_stream_prefix_ex(struct zlog_stream *stream, const char *function, int line)
Definition zlog.c:669

Definition at line 104 of file zlog.h.

◆ ZLOG_SYSERROR

#define ZLOG_SYSERROR   (ZLOG_ERROR | ZLOG_HAVE_ERRNO)

Definition at line 53 of file zlog.h.

◆ ZLOG_SYSLOG

#define ZLOG_SYSLOG   -2

Definition at line 55 of file zlog.h.

◆ ZLOG_TRUE

#define ZLOG_TRUE   1

Definition at line 16 of file zlog.h.

Typedef Documentation

◆ zlog_bool

typedef unsigned char zlog_bool

Definition at line 14 of file zlog.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ZLOG_DEBUG 
ZLOG_NOTICE 
ZLOG_WARNING 
ZLOG_ERROR 
ZLOG_ALERT 

Definition at line 41 of file zlog.h.

Function Documentation

◆ vzlog()

void vzlog ( const char * function,
int line,
int flags,
const char * fmt,
va_list args )

Definition at line 198 of file zlog.c.

◆ zlog_ex()

void zlog_ex ( const char * function,
int line,
int flags,
const char * fmt,
... )

◆ zlog_get_level_name()

const char * zlog_get_level_name ( int log_level)

Definition at line 59 of file zlog.c.

◆ zlog_msg_ex()

void void zlog_msg_ex ( const char * function,
int line,
int flags,
const char * prefix,
const char * msg )

Definition at line 272 of file zlog.c.

◆ zlog_print_time()

size_t zlog_print_time ( struct timeval * tv,
char * timebuf,
size_t timebuf_len )

Definition at line 77 of file zlog.c.

◆ zlog_set_buffering()

int zlog_set_buffering ( zlog_bool buffering)

Definition at line 123 of file zlog.c.

◆ zlog_set_external_logger()

void zlog_set_external_logger ( void(* logger )(int, char *, size_t))

Definition at line 53 of file zlog.c.

◆ zlog_set_fd()

int zlog_set_fd ( int new_fd,
zlog_bool is_stderr )

Definition at line 92 of file zlog.c.

◆ zlog_set_launched()

void zlog_set_launched ( void )

Definition at line 71 of file zlog.c.

◆ zlog_set_level()

int zlog_set_level ( int new_value)

Definition at line 103 of file zlog.c.

◆ zlog_set_limit()

int zlog_set_limit ( int new_value)

Definition at line 114 of file zlog.c.

◆ zlog_stream_close()

zlog_bool zlog_stream_close ( struct zlog_stream * stream)

Definition at line 878 of file zlog.c.

◆ zlog_stream_destroy()

void zlog_stream_destroy ( struct zlog_stream * stream)

Definition at line 862 of file zlog.c.

◆ zlog_stream_finish()

zlog_bool zlog_stream_finish ( struct zlog_stream * stream)

Definition at line 838 of file zlog.c.

◆ zlog_stream_format()

ssize_t zlog_stream_format ( struct zlog_stream * stream,
const char * fmt,
... )

◆ zlog_stream_init()

void zlog_stream_init ( struct zlog_stream * stream,
int flags )

Definition at line 537 of file zlog.c.

◆ zlog_stream_init_ex()

void zlog_stream_init_ex ( struct zlog_stream * stream,
int flags,
int fd )

Definition at line 543 of file zlog.c.

◆ zlog_stream_prefix_ex()

ssize_t zlog_stream_prefix_ex ( struct zlog_stream * stream,
const char * function,
int line )

Definition at line 669 of file zlog.c.

◆ zlog_stream_set_child_pid()

void zlog_stream_set_child_pid ( struct zlog_stream * stream,
int child_pid )

Definition at line 574 of file zlog.c.

◆ zlog_stream_set_decorating()

void zlog_stream_set_decorating ( struct zlog_stream * stream,
zlog_bool decorate )

Definition at line 550 of file zlog.c.

◆ zlog_stream_set_is_stdout()

void zlog_stream_set_is_stdout ( struct zlog_stream * stream,
zlog_bool is_stdout )

Definition at line 568 of file zlog.c.

◆ zlog_stream_set_msg_prefix()

zlog_bool zlog_stream_set_msg_prefix ( struct zlog_stream * stream,
const char * fmt,
... )

◆ zlog_stream_set_msg_quoting()

void zlog_stream_set_msg_quoting ( struct zlog_stream * stream,
zlog_bool quote )

Definition at line 580 of file zlog.c.

◆ zlog_stream_set_msg_suffix()

zlog_bool zlog_bool zlog_stream_set_msg_suffix ( struct zlog_stream * stream,
const char * suffix,
const char * final_suffix )

Definition at line 614 of file zlog.c.

◆ zlog_stream_set_wrapping()

void zlog_stream_set_wrapping ( struct zlog_stream * stream,
zlog_bool wrap )

Definition at line 562 of file zlog.c.

◆ zlog_stream_str()

ssize_t zlog_stream_str ( struct zlog_stream * stream,
const char * str,
size_t str_len )

Definition at line 748 of file zlog.c.

◆ zlog_stream_vformat()

ssize_t ssize_t zlog_stream_vformat ( struct zlog_stream * stream,
const char * fmt,
va_list args )

Definition at line 724 of file zlog.c.