format.h 810 Bytes
Newer Older
Hardy Simpson's avatar
Hardy Simpson committed
1
/*
Hardy Simpson's avatar
Hardy Simpson committed
2
 * This file is part of the zlog Library.
Hardy Simpson's avatar
Hardy Simpson committed
3
 *
Hardy Simpson's avatar
Hardy Simpson committed
4
 * Copyright (C) 2011 by Hardy Simpson <HardySimpson1984@gmail.com>
Hardy Simpson's avatar
Hardy Simpson committed
5
 *
6
 * Licensed under the LGPL v2.1, see the file COPYING in base directory.
Hardy Simpson's avatar
Hardy Simpson committed
7 8
 */

Hardy Simpson's avatar
Hardy Simpson committed
9 10
#ifndef __zlog_format_h
#define __zlog_format_h
Hardy Simpson's avatar
Hardy Simpson committed
11 12 13 14

#include "thread.h"
#include "zc_defs.h"

Hardy Simpson's avatar
Hardy Simpson committed
15
typedef struct zlog_format_s zlog_format_t;
Hardy Simpson's avatar
Hardy Simpson committed
16

Hardy Simpson's avatar
Hardy Simpson committed
17 18 19 20 21 22
struct zlog_format_s {
	char name[MAXLEN_CFG_LINE + 1];	
	char pattern[MAXLEN_CFG_LINE + 1];
	zc_arraylist_t *pattern_specs;
};

23
zlog_format_t *zlog_format_new(char *line, int * time_cache_count);
Hardy Simpson's avatar
Hardy Simpson committed
24
void zlog_format_del(zlog_format_t * a_format);
Hardy Simpson's avatar
Hardy Simpson committed
25 26
void zlog_format_profile(zlog_format_t * a_format, int flag);

Hardy Simpson's avatar
Hardy Simpson committed
27
int zlog_format_gen_msg(zlog_format_t * a_format, zlog_thread_t * a_thread);
Hardy Simpson's avatar
Hardy Simpson committed
28

Hardy Simpson's avatar
Hardy Simpson committed
29 30 31
#define zlog_format_has_name(a_format, fname) \
	STRCMP(a_format->name, ==, fname)

Hardy Simpson's avatar
Hardy Simpson committed
32
#endif