Skip to content

Commit 273b0a3

Browse files
author
legoater
committed
*** empty log message ***
1 parent d6babcb commit 273b0a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+147
-263
lines changed

.cvsignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ config.log
66
configure
77
Makefile.in
88
aclocal.m4
9+
autom4te-*.cache

AUTHORS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
C�dric Le Goater <legoater@cimai.com>
1+
C�dric Le Goater <legoater@meiosys.com>

ChangeLog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2002-11-21 C�dric Le goater <[email protected]>
2+
3+
* Changelog: log4c-1.0.10
4+
* category.c (__log4c_category_vlog): did some optimizations
5+
* init.h: exported resource configuration API rc.h
6+
* sd: synchronized from sd dev tree
7+
18
2002-08-20 C�dric Le goater <[email protected]>
29

310
* Changelog: log4c-1.0.8

Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ BUILT_SOURCES=log4c-config
2020
m4datadir = $(datadir)/aclocal
2121
m4data_DATA = log4c.m4
2222

23-
sysconf_DATA = log4crc
23+
sysconf_DATA = log4crc.sample
2424

2525
rpm: dist
26-
rpmbuild -ta ${distdir}.tar.gz
26+
rpmbuild --clean -ta ${distdir}.tar.gz

README

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This is the distribution of Log4C
2424

2525
expat http://sourceforge.net/projects/expat
2626

27-
log4c http://www.cimai.com/opensource/log4c
27+
log4c http://www.meiosys.com/opensource/log4c
2828
http://sourceforge.net/projects/log4c
2929

3030

@@ -41,9 +41,7 @@ This is the distribution of Log4C
4141
$ make
4242
$ make install
4343

44-
4544
Have Fun !!
4645

4746
C�dric Le Goater <[email protected]>
4847

49-

configure.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ AM_CONFIG_HEADER(src/config.h)
99

1010
LOG4C_MAJOR_VERSION=1
1111
LOG4C_MINOR_VERSION=0
12-
LOG4C_MICRO_VERSION=8
12+
LOG4C_MICRO_VERSION=9
1313
VERSION=$LOG4C_MAJOR_VERSION.$LOG4C_MINOR_VERSION.$LOG4C_MICRO_VERSION
1414

1515
# +1 : ? : +1 == new interface that does not break old one
@@ -18,7 +18,7 @@ VERSION=$LOG4C_MAJOR_VERSION.$LOG4C_MINOR_VERSION.$LOG4C_MICRO_VERSION
1818
# ? :+1 : ? == just some internal changes, nothing breaks but might work
1919
# better
2020
# CURRENT : REVISION : AGE
21-
LT_VERSION=1:8:0
21+
LT_VERSION=1:9:0
2222

2323
AC_SUBST(LOG4C_MAJOR_VERSION)
2424
AC_SUBST(LOG4C_MINOR_VERSION)
@@ -100,7 +100,7 @@ AM_CONDITIONAL(DOC, test x$enable_doc = xyes)
100100
AC_CONFIG_FILES([
101101
Makefile
102102
log4c-config
103-
log4crc
103+
log4crc.sample
104104
log4c.spec
105105
config/Makefile
106106
doc/Makefile

doc/main.doc.in

+2-10
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ so you will need GCC to compile it. This will probably change one day.
7272

7373
@subsection installation_tarballs Building from source tarballs
7474

75-
Local tarballs:
76-
@li <a href="log4c-@[email protected]">log4c-@[email protected]</a>
77-
7875
on SourceForge:
7976
@li <a href="http://prdownloads.sourceforge.net/log4c/log4c-@[email protected]">log4c-@[email protected]</a>
8077

@@ -97,11 +94,6 @@ documentation for more information.
9794

9895
@subsection installation_rpm Using RPMs
9996

100-
Local RPMs:
101-
@li <a href="log4c-@[email protected]">log4c-@[email protected]</a>
102-
@li <a href="log4c-devel-@[email protected]">log4c-devel-@[email protected]</a>
103-
@li <a href="log4c-doc-@[email protected]">log4c-doc-@[email protected]</a>
104-
10597
on SourceForge:
10698
@li <a href=""http://prdownloads.sourceforge.net/log4c/log4c-@[email protected]">log4c-@[email protected]</a>
10799
@li <a href=""http://prdownloads.sourceforge.net/log4c/log4c-devel-@[email protected]">log4c-devel-@[email protected]</a>
@@ -184,8 +176,8 @@ href="http://log4cpp.sourceforge.net/">Log4Cpp</a>.
184176

185177
@section copyright Copyright
186178

187-
All software in this package is Copyright � 2001-2002 Cimai Technology
188-
http://www.cimai.com and C�dric Le Goater <[email protected]> and is
179+
All software in this package is Copyright � 2001-2002 Meiosys
180+
http://www.meiosys.com and C�dric Le Goater <[email protected]> and is
189181
distributed under the <a
190182
href="http://www.gnu.org/licenses/lgpl.html">LGPL</a> License. See the @c
191183
COPYING file for full legal details.

log4crc.in log4crc.sample.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<log4c version="@VERSION@">
55

66
<config>
7-
<nocleanup>0</nocleanup>
87
<bufsize>0</bufsize>
98
<debug level="0"/>
9+
<nocleanup>0</nocleanup>
1010
</config>
1111

1212
<!-- root category ========================================= -->

src/log4c.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* $Id$
22
*
33
* log4c.h
4-
*
5-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
6-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
4+
*
5+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
6+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
77
*
88
* See the COPYING file for the terms of usage and distribution.
99
*/
@@ -13,6 +13,7 @@
1313

1414
#include <log4c/version.h>
1515
#include <log4c/init.h>
16+
#include <log4c/rc.h>
1617
#include <log4c/appender.h>
1718
#include <log4c/category.h>
1819
#include <log4c/layout.h>

src/log4c/Makefile.am

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ lib_LTLIBRARIES = liblog4c.la
77

88
liblog4c_la_SOURCES = \
99
rc.c \
10-
rc.h \
11-
\
1210
init.c \
1311
appender_type_stream.c \
1412
appender_type_syslog.c \
1513
appender_type_mmap.c \
1614
layout_type_basic.c \
1715
layout_type_dated.c \
18-
\
1916
version.c \
2017
logging_event.c \
2118
priority.c \
@@ -27,6 +24,7 @@ liblog4c_la_LDFLAGS = -version-info @LT_VERSION@
2724
liblog4c_la_LIBADD = @EXPAT_LIBS@ ../sd/liblog4c_sd.la
2825

2926
pkginclude_HEADERS = \
27+
rc.h \
3028
init.h \
3129
defs.h \
3230
version.h \

src/log4c/appender.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ static const char version[] = "$Id$";
33
/*
44
* appender.c
55
*
6-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
7-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
6+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
7+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
88
*
99
* See the COPYING file for the terms of usage and distribution.
1010
*/

src/log4c/appender.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
*
33
* appender.h
44
*
5-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
6-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
5+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
6+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
77
*
88
* See the COPYING file for the terms of usage and distribution.
99
*/

src/log4c/appender_type_mmap.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ static const char version[] = "$Id$";
33
/*
44
* appender_mmap.c
55
*
6-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
7-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
6+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
7+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
88
*
99
* See the COPYING file for the terms of usage and distribution.
1010
*/

src/log4c/appender_type_mmap.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
*
33
* appender_type_mmap.h
44
*
5-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
6-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
5+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
6+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
77
*
88
* See the COPYING file for the terms of usage and distribution.
99
*/

src/log4c/appender_type_stream.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ static const char version[] = "$Id$";
33
/*
44
* appender_stream.c
55
*
6-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
7-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
6+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
7+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
88
*
99
* See the COPYING file for the terms of usage and distribution.
1010
*/

src/log4c/appender_type_stream.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
*
33
* appender_type_stream.h
44
*
5-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
6-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
5+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
6+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
77
*
88
* See the COPYING file for the terms of usage and distribution.
99
*/

src/log4c/appender_type_syslog.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ static const char version[] = "$Id$";
33
/*
44
* appender_syslog.c
55
*
6-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
7-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
6+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
7+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
88
*
99
* See the COPYING file for the terms of usage and distribution.
1010
*/

src/log4c/appender_type_syslog.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
*
33
* appender_type_syslog.h
44
*
5-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
6-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
5+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
6+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
77
*
88
* See the COPYING file for the terms of usage and distribution.
99
*/

src/log4c/category.c

+22-20
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ static const char version[] = "$Id$";
33
/*
44
* category.c
55
*
6-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
7-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
6+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
7+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
88
*
99
* See the COPYING file for the terms of usage and distribution.
1010
*/
@@ -191,19 +191,6 @@ extern void log4c_category_print(const log4c_category_t* this, FILE* a_stream)
191191
}
192192

193193
/*******************************************************************************/
194-
static void call_appenders(const log4c_category_t* this,
195-
log4c_logging_event_t* a_event)
196-
{
197-
if (!this)
198-
return;
199-
200-
if (this->cat_appender)
201-
log4c_appender_append(this->cat_appender, a_event);
202-
203-
if (this->cat_additive && this->cat_parent)
204-
call_appenders(this->cat_parent, a_event);
205-
}
206-
207194
extern void __log4c_category_vlog(const log4c_category_t* this,
208195
const log4c_location_info_t* a_locinfo,
209196
int a_priority,
@@ -212,21 +199,31 @@ extern void __log4c_category_vlog(const log4c_category_t* this,
212199
{
213200
char* message;
214201
log4c_logging_event_t evt;
202+
const log4c_category_t* cat;
203+
int yes = 0;
215204

216205
if (!this)
217206
return;
207+
208+
/* check if an appender is defined in the category hierarchy */
209+
for (cat = this; cat; cat = cat->cat_parent) {
210+
if (cat->cat_appender)
211+
yes++;
212+
}
213+
214+
if (!yes)
215+
return;
218216

219217
if (!log4c_rc->config.bufsize)
220218
message = sd_vsprintf(a_format, a_args);
221219
else {
222220
int n;
223-
221+
224222
message = alloca(log4c_rc->config.bufsize);
225223
if ( (n = vsnprintf(message, log4c_rc->config.bufsize, a_format, a_args))
226224
>= log4c_rc->config.bufsize)
227225
sd_error("truncating message of %d bytes (bufsize = %d)", n,
228-
log4c_rc->config.bufsize);
229-
226+
log4c_rc->config.bufsize);
230227
}
231228

232229
evt.evt_category = this->cat_name;
@@ -235,8 +232,13 @@ extern void __log4c_category_vlog(const log4c_category_t* this,
235232
evt.evt_loc = a_locinfo;
236233
gettimeofday(&evt.evt_timestamp, NULL);
237234

238-
call_appenders(this, &evt);
239-
235+
for (cat = this; cat; cat = cat->cat_parent) {
236+
if (cat->cat_appender)
237+
log4c_appender_append(cat->cat_appender, &evt);
238+
239+
if (!cat->cat_additive) break;
240+
}
241+
240242
if (!log4c_rc->config.bufsize)
241243
free(message);
242244
}

src/log4c/category.h

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
*
33
* category.h
44
*
5-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
6-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
5+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
6+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
77
*
88
* See the COPYING file for the terms of usage and distribution.
99
*/
@@ -292,7 +292,6 @@ static inline void log4c_category_vlog(const log4c_category_t* a_category,
292292
__log4c_category_vlog(a_category, &locinfo, a_priority, a_format, a_args);
293293
}
294294

295-
296295
/**
297296
* Log a message with the specified priority.
298297
* @param a_category the log4c_category_t object
@@ -492,7 +491,6 @@ static inline void __log4c_category_trace(const log4c_category_t* a_category,
492491
# define log4c_category_trace __log4c_category_trace
493492
#endif
494493

495-
496494
/**
497495
* Helper macro to define static categories.
498496
*
@@ -509,7 +507,6 @@ static void __attribute__ ((constructor)) __log4c_init_category##a_category(void
509507
# define log4c_category_define(a_category, a_name)
510508
#endif
511509

512-
513510
/**
514511
* @internal
515512
**/

src/log4c/defs.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* $Id$
22
*
3-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
4-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
3+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
4+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
55
*
66
* See the COPYING file for the terms of usage and distribution.
77
*/

src/log4c/init.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ static const char version[] = "$Id$";
33
/*
44
* init.c
55
*
6-
* Copyright 2001-2002, Cimai Technology SA (www.cimai.com). All rights reserved.
7-
* Copyright 2001-2002, Cedric Le Goater <legoater@cimai.com>. All rights reserved.
6+
* Copyright 2001-2002, Meiosys SA (www.meiosys.com). All rights reserved.
7+
* Copyright 2001-2002, Cedric Le Goater <legoater@meiosys.com>. All rights reserved.
88
*
99
* See the COPYING file for the terms of usage and distribution.
1010
*/
@@ -96,7 +96,6 @@ extern int log4c_fini(void)
9696
return 0;
9797
}
9898

99-
10099
/******************************************************************************/
101100
#ifdef __GNUC__
102101
extern void __attribute__ ((constructor)) __log4c_init(void)

0 commit comments

Comments
 (0)