OSSP CVS Repository

ossp - Check-in [469]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 469
Date: 2001-May-17 16:40:34 (local)
2001-May-17 14:40:34 (UTC)
User:simons
Branch:
Comment: Added l2_log.c module, which contains l2_stream_log() and l2_stream_vlog().
Tickets:
Inspections:
Files:
ossp-pkg/l2/Makefile.in      1.3 -> 1.4     9 inserted, 8 deleted
ossp-pkg/l2/l2_log.c      added-> 1.1

ossp-pkg/l2/Makefile.in 1.3 -> 1.4

--- Makefile.in  2001/05/11 19:50:52     1.3
+++ Makefile.in  2001/05/17 14:40:34     1.4
@@ -62,6 +62,7 @@
 
 #   list of library object files
 OBJS = \
+    l2_log.lo \
     l2_stream.lo \
     l2_channel.lo \
     l2_ch_fd.lo \
@@ -107,13 +108,13 @@
         $(LIBTOOL) --mode=compile --quiet $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
 
 #   default target
-all: $(TARGET) 
+all: $(TARGET)
 
 #   build libraries
-libl2.la: $(OBJS) 
+libl2.la: $(OBJS)
         $(LIBTOOL) --mode=link --quiet $(CC) -o libl2.la $(OBJS) -rpath $(libdir) \
             -version-info `$(SHTOOL) version -l c -d libtool l2_version.c`
-libl2++.la: $(OBJS) l2++.lo 
+libl2++.la: $(OBJS) l2++.lo
         $(LIBTOOL) --mode=link --quiet $(CC) -o libl2++.la $(OBJS) l2++.lo -rpath $(libdir) \
             -version-info `$(SHTOOL) version -l c -d libtool l2_version.c`
 
@@ -168,7 +169,7 @@
             libl2++.la $(DESTDIR)$(libdir)/libl2++.la
 
 #   perform standard uninstallation procedure
-uninstall: 
+uninstall:
         $(MAKE) $(MFLAGS) @UNINSTALL_CXX@ uninstall-c uninstall-std
 uninstall-cxx:
         @$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libl2++.la
@@ -188,7 +189,7 @@
         $(RMDIR) $(DESTDIR)$(includedir)
         $(RMDIR) $(DESTDIR)$(bindir)
 
-#   remove everything which can be regenerated 
+#   remove everything which can be regenerated
 #   by "make all"
 clean:
         $(RM) *.lo *.o
@@ -196,8 +197,8 @@
         -$(RMDIR) .libs >/dev/null 2>&1 || $(TRUE)
         $(RM) $(TARGET_LIBS)
         $(RM) $(TARGET_TESTS)
-        
-#   remove everything which can be regenerated 
+
+#   remove everything which can be regenerated
 #   by "./configure && make all"
 distclean: clean
         $(RM) l2-config
@@ -206,7 +207,7 @@
         $(RM) libtool
         $(RM) Makefile
 
-#   remove everything which can be regenerated 
+#   remove everything which can be regenerated
 #   by "autoconf && autoheader && ./configure && make all"
 realclean: distclean
         $(RM) configure


ossp-pkg/l2/l2_log.c -> 1.1

*** /dev/null    Wed Oct 20 00:15:37 2021
--- -    Wed Oct 20 00:18:06 2021
***************
*** 0 ****
--- 1,50 ----
+ /*
+ **  L2 - OSSP Logging Library
+ **  Copyright (c) 2001 The OSSP Project (http://www.ossp.org/)
+ **  Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/)
+ **
+ **  This file is part of OSSP L2, a flexible logging library which
+ **  can be found at http://www.ossp.com/pkg/l2/.
+ **
+ **  Permission to use, copy, modify, and distribute this software for
+ **  any purpose with or without fee is hereby granted, provided that
+ **  the above copyright notice and this permission notice appear in all
+ **  copies.
+ **
+ **  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ **  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ **  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ **  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ **  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ **  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ **  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ **  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ **  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ **  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ **  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ **  SUCH DAMAGE.
+ **
+ **  l2.c: internal C implementation
+ **
+ */
+ 
+ #include "l2.h"
+ #include "l2_p.h"
+ 
+ void l2_stream_log(l2_stream_t *st, unsigned int log_level, const char* fmt, ...)
+     {
+     va_list ap;
+     va_start(ap, fmt);
+     l2_stream_vlog(st, log_level, fmt, ap);
+     va_end(ap);
+     }
+ 
+ void l2_stream_vlog(l2_stream_t *st, unsigned int log_level, const char* fmt, va_list ap)
+     {
+     size_t i, len;
+     len = vsnprintf(st->message, L2_MAX_MSGSIZE, fmt, ap);
+     for (i = 0; i <= L2_MAX_CHANNELS && st->channels[i]; ++i)
+        st->channels[i]->handler.write(&st->channels[i]->context,
+                                       st->channels[i]->below,
+                                       st->message, len);
+     }

CVSTrac 2.0.1