Browse Source

moved logger to separate archive

release0.1.5
Georg Hopp 14 years ago
parent
commit
7a717ad8f0
  1. 3
      configure.ac
  2. 1
      include/http.h
  3. 0
      include/http/interface/http_intro.h
  4. 52
      include/logger.h
  5. 6
      include/logger/interface/logger.h
  6. 57
      include/logger/logger.h
  7. 12
      src/Makefile.am
  8. BIN
      src/auth/libauth.a
  9. BIN
      src/cbuf/libcbuf.a
  10. BIN
      src/class/libclass.a
  11. BIN
      src/hash/libhash.a
  12. 2
      src/http/Makefile.am
  13. 2
      src/http/interface/http_intro.c
  14. BIN
      src/http/libhttp.a
  15. 2
      src/http/message/header_size_get.c
  16. 2
      src/http/message/header_to_string.c
  17. 7
      src/http/parser/parse.c
  18. 2
      src/http/request.c
  19. 4
      src/http/response.c
  20. 2
      src/interface/stream_reader.c
  21. 6
      src/logger/Makefile.am
  22. 4
      src/logger/interface/logger.c
  23. BIN
      src/logger/liblogger.a
  24. 4
      src/logger/logger.c
  25. 4
      src/logger/stderr.c
  26. 4
      src/logger/syslog.c
  27. 2
      src/server/handle_accept.c
  28. 2
      src/server/poll.c
  29. 2
      src/server/read.c
  30. 2
      src/server/run.c
  31. 2
      src/server/write.c
  32. 1
      src/socket.c
  33. 2
      src/socket/accept.c
  34. 2
      src/socket/connect.c
  35. 2
      src/socket/listen.c
  36. 2
      src/taskrambler.c

3
configure.ac

@ -5,7 +5,7 @@ AC_PREREQ([2.68])
AC_INIT([taskrambler], [0.0.1], [Georg Hopp <georg@steffers.org>]) AC_INIT([taskrambler], [0.0.1], [Georg Hopp <georg@steffers.org>])
LT_INIT LT_INIT
AM_INIT_AUTOMAKE([subdir-objects]) AM_INIT_AUTOMAKE([subdir-objects])
#AM_SILENT_RULES([yes])
AM_SILENT_RULES([yes])
AC_COPYRIGHT([Copyright © 2012 Georg Hopp]) AC_COPYRIGHT([Copyright © 2012 Georg Hopp])
AC_REVISION([$Revision: 0.01 $]) AC_REVISION([$Revision: 0.01 $])
AC_CONFIG_SRCDIR([src/taskrambler.c]) AC_CONFIG_SRCDIR([src/taskrambler.c])
@ -52,5 +52,6 @@ AC_CONFIG_FILES([Makefile
src/class/Makefile src/class/Makefile
src/hash/Makefile src/hash/Makefile
src/http/Makefile src/http/Makefile
src/logger/Makefile
tests/Makefile]) tests/Makefile])
AC_OUTPUT AC_OUTPUT

1
include/http.h

@ -10,6 +10,7 @@
#include "http/parser.h" #include "http/parser.h"
#include "http/writer.h" #include "http/writer.h"
#include "http/worker.h" #include "http/worker.h"
#include "http/interface/http_intro.h"
#endif // __HTTP_H__ #endif // __HTTP_H__

0
include/interface/http_intro.h → include/http/interface/http_intro.h

52
include/logger.h

@ -1,56 +1,8 @@
/**
* \file
* A generic logger class and two extended classes, One that logs to
* stderr and one that logs to the system syslog.
*
* \author Georg Hopp
*
* \copyright
* Copyright © 2012 Georg Hopp
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LOGGER_H__ #ifndef __LOGGER_H__
#define __LOGGER_H__ #define __LOGGER_H__
#include "class.h"
typedef enum logger_level {
LOGGER_DEBUG=0,
LOGGER_INFO,
LOGGER_NOTICE,
LOGGER_WARNING,
LOGGER_ERR,
LOGGER_CRIT,
LOGGER_ALERT,
LOGGER_EMERG
} logger_level;
extern const char * const logger_level_str[];
CLASS(Logger) {
logger_level min_level;
};
CLASS(LoggerStderr) {
EXTENDS(Logger);
};
CLASS(LoggerSyslog) {
EXTENDS(Logger);
};
#include "logger/logger.h"
#include "logger/interface/logger.h"
#endif // __LOGGER_H__ #endif // __LOGGER_H__

6
include/interface/logger.h → include/logger/interface/logger.h

@ -21,8 +21,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __INTERFACE_LOGGER_H__
#define __INTERFACE_LOGGER_H__
#ifndef __LOGGER_INTERFACE_LOGGER_H__
#define __LOGGER_INTERFACE_LOGGER_H__
#include <stdarg.h> #include <stdarg.h>
@ -40,6 +40,6 @@ struct i_Logger {
extern void loggerLog(void *, logger_level, const char * const, ...); extern void loggerLog(void *, logger_level, const char * const, ...);
#endif // __INTERFACE_LOGGER_H__
#endif // __LOGGER_INTERFACE_LOGGER_H__
// vim: set ts=4 sw=4: // vim: set ts=4 sw=4:

57
include/logger/logger.h

@ -0,0 +1,57 @@
/**
* \file
* A generic logger class and two extended classes, One that logs to
* stderr and one that logs to the system syslog.
*
* \author Georg Hopp
*
* \copyright
* Copyright © 2012 Georg Hopp
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LOGGER_LOGGER_H__
#define __LOGGER_LOGGER_H__
#include "class.h"
typedef enum logger_level {
LOGGER_DEBUG=0,
LOGGER_INFO,
LOGGER_NOTICE,
LOGGER_WARNING,
LOGGER_ERR,
LOGGER_CRIT,
LOGGER_ALERT,
LOGGER_EMERG
} logger_level;
extern const char * const logger_level_str[];
CLASS(Logger) {
logger_level min_level;
};
CLASS(LoggerStderr) {
EXTENDS(Logger);
};
CLASS(LoggerSyslog) {
EXTENDS(Logger);
};
#endif // __LOGGER_LOGGER_H__
// vim: set ts=4 sw=4:

12
src/Makefile.am

@ -1,13 +1,12 @@
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
IFACE = interface/stream_reader.c interface/logger.c \
interface/stream_writer.c interface/http_intro.c \
IFACE = interface/stream_reader.c \
interface/stream_writer.c \
interface/subject.c interface/observer.c interface/subject.c interface/observer.c
SOCKET = socket.c socket/accept.c socket/connect.c socket/listen.c SOCKET = socket.c socket/accept.c socket/connect.c socket/listen.c
STREAM = stream.c stream/read.c stream/write.c STREAM = stream.c stream/read.c stream/write.c
SERVER = server.c server/run.c server/close_conn.c server/poll.c \ SERVER = server.c server/run.c server/close_conn.c server/poll.c \
server/handle_accept.c server/read.c server/write.c server/handle_accept.c server/read.c server/write.c
LOGGER = logger.c logger/stderr.c logger/syslog.c
SESSION = session.c session/add.c session/get.c session/delete.c SESSION = session.c session/add.c session/get.c session/delete.c
UTILS = utils/hash.c \ UTILS = utils/hash.c \
utils/memory.c \ utils/memory.c \
@ -19,17 +18,18 @@ LIBS = ./http/libhttp.a \
./auth/libauth.a \ ./auth/libauth.a \
./cbuf/libcbuf.a \ ./cbuf/libcbuf.a \
./class/libclass.a \ ./class/libclass.a \
./hash/libhash.a
./hash/libhash.a \
./logger/liblogger.a
AM_CFLAGS = -Wall -I ../include/ AM_CFLAGS = -Wall -I ../include/
bin_PROGRAMS = taskrambler bin_PROGRAMS = taskrambler
taskrambler_SOURCES = taskrambler.c \ taskrambler_SOURCES = taskrambler.c \
$(IFACE) $(SOCKET) $(SERVER) $(LOGGER) \
$(IFACE) $(SOCKET) $(SERVER) \
$(UTILS) $(SESSION) $(STREAM) $(UTILS) $(SESSION) $(STREAM)
taskrambler_CFLAGS = -Wall -I ../include/ $(COVERAGE_CFLAGS) taskrambler_CFLAGS = -Wall -I ../include/ $(COVERAGE_CFLAGS)
taskrambler_LDADD = $(LIBS) -lrt -lssl -lldap taskrambler_LDADD = $(LIBS) -lrt -lssl -lldap
taskrambler_LDFLAGS = $(COVERAGE_LDFLAGS) taskrambler_LDFLAGS = $(COVERAGE_LDFLAGS)
SUBDIRS = auth cbuf class hash http
SUBDIRS = auth cbuf class hash http logger

BIN
src/auth/libauth.a

BIN
src/cbuf/libcbuf.a

BIN
src/class/libclass.a

BIN
src/hash/libhash.a

2
src/http/Makefile.am

@ -37,5 +37,5 @@ HEADER = header.c \
noinst_LIBRARIES = libhttp.a noinst_LIBRARIES = libhttp.a
libhttp_a_SOURCES = $(MSG) $(MSGQ) $(REQ) $(RESP) $(PARSER) $(WRITER) \ libhttp_a_SOURCES = $(MSG) $(MSGQ) $(REQ) $(RESP) $(PARSER) $(WRITER) \
$(WORKER) $(HEADER)
$(WORKER) $(HEADER) interface/http_intro.c
libhttp_a_CFLAGS = -Wall -I ../../include/ libhttp_a_CFLAGS = -Wall -I ../../include/

2
src/interface/http_intro.c → src/http/interface/http_intro.c

@ -21,7 +21,7 @@
*/ */
#include "class.h" #include "class.h"
#include "interface/http_intro.h"
#include "http/interface/http_intro.h"
const struct interface i_HttpIntro = { const struct interface i_HttpIntro = {
"httpIntro", "httpIntro",

BIN
src/http/libhttp.a

2
src/http/message/header_size_get.c

@ -27,7 +27,7 @@
#include "http/message.h" #include "http/message.h"
#include "http/response.h" #include "http/response.h"
#include "http/header.h" #include "http/header.h"
#include "interface/http_intro.h"
#include "http/interface/http_intro.h"
#include "hash.h" #include "hash.h"
static size_t size; static size_t size;

2
src/http/message/header_to_string.c

@ -26,7 +26,7 @@
#include "http/response.h" #include "http/response.h"
#include "http/header.h" #include "http/header.h"
#include "interface/http_intro.h"
#include "http/interface/http_intro.h"
#include "hash.h" #include "hash.h"
static char * string; static char * string;

7
src/http/parser/parse.c

@ -22,13 +22,14 @@
#include <stdlib.h> #include <stdlib.h>
#include "http/parser.h"
#include "http/header.h"
#include "class.h" #include "class.h"
#include "interface/http_intro.h"
#include "cbuf.h" #include "cbuf.h"
#include "stream.h" #include "stream.h"
#include "http/parser.h"
#include "http/header.h"
#include "http/interface/http_intro.h"
#include "utils/memory.h" #include "utils/memory.h"
#include "commons.h" #include "commons.h"

2
src/http/request.c

@ -27,7 +27,7 @@
#include "class.h" #include "class.h"
#include "hash.h" #include "hash.h"
#include "interface/http_intro.h"
#include "http/interface/http_intro.h"
#include "http/request.h" #include "http/request.h"
#include "utils/memory.h" #include "utils/memory.h"

4
src/http/response.c

@ -27,10 +27,10 @@
#include <stdio.h> #include <stdio.h>
#include "class.h" #include "class.h"
#include "interface/http_intro.h"
#include "utils/memory.h"
#include "http/response.h" #include "http/response.h"
#include "utils/memory.h"
#include "http/interface/http_intro.h"
static static

2
src/interface/stream_reader.c

@ -21,8 +21,8 @@
*/ */
#include "class.h" #include "class.h"
#include "interface/stream_reader.h"
#include "stream.h" #include "stream.h"
#include "interface/stream_reader.h"
const struct interface i_StreamReader = { const struct interface i_StreamReader = {
"streamReader", "streamReader",

6
src/logger/Makefile.am

@ -0,0 +1,6 @@
ACLOCAL_AMFLAGS = -I m4
noinst_LIBRARIES = liblogger.a
liblogger_a_SOURCES = interface/logger.c logger.c stderr.c syslog.c
liblogger_a_CFLAGS = -Wall -I ../../include/

4
src/interface/logger.c → src/logger/interface/logger.c

@ -24,8 +24,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include "logger.h"
#include "interface/logger.h"
#include "logger/logger.h"
#include "logger/interface/logger.h"
const struct interface i_Logger = { const struct interface i_Logger = {
"logger", "logger",

BIN
src/logger/liblogger.a

4
src/logger.c → src/logger/logger.c

@ -22,9 +22,9 @@
#include <stdarg.h> #include <stdarg.h>
#include "logger.h"
#include "class.h" #include "class.h"
#include "interface/logger.h"
#include "logger/logger.h"
#include "logger/interface/logger.h"
const const
char * const char * const

4
src/logger/stderr.c

@ -22,8 +22,8 @@
#include <stdio.h> #include <stdio.h>
#include "logger.h"
#include "interface/logger.h"
#include "logger/logger.h"
#include "logger/interface/logger.h"
static static
void void

4
src/logger/syslog.c

@ -22,8 +22,8 @@
#include <syslog.h> #include <syslog.h>
#include "logger.h"
#include "interface/logger.h"
#include "logger/logger.h"
#include "logger/interface/logger.h"
static static
const const

2
src/server/handle_accept.c

@ -29,7 +29,7 @@
#include "http/worker.h" #include "http/worker.h"
#include "server.h" #include "server.h"
#include "class.h" #include "class.h"
#include "interface/logger.h"
#include "logger.h"
#include "stream.h" #include "stream.h"
int int

2
src/server/poll.c

@ -24,7 +24,7 @@
#include <errno.h> #include <errno.h>
#include "server.h" #include "server.h"
#include "interface/logger.h"
#include "logger.h"
#include "utils/signalHandling.h" #include "utils/signalHandling.h"

2
src/server/read.c

@ -21,7 +21,7 @@
*/ */
#include "server.h" #include "server.h"
#include "interface/logger.h"
#include "logger.h"
#include "interface/stream_reader.h" #include "interface/stream_reader.h"
void serverCloseConn(Server, unsigned int); void serverCloseConn(Server, unsigned int);

2
src/server/run.c

@ -21,7 +21,7 @@
*/ */
#include "server.h" #include "server.h"
#include "interface/logger.h"
#include "logger.h"
#include "utils/signalHandling.h" #include "utils/signalHandling.h"

2
src/server/write.c

@ -21,7 +21,7 @@
*/ */
#include "server.h" #include "server.h"
#include "interface/logger.h"
#include "logger.h"
#include "interface/stream_writer.h" #include "interface/stream_writer.h"
void serverCloseConn(Server, unsigned int); void serverCloseConn(Server, unsigned int);

1
src/socket.c

@ -27,7 +27,6 @@
#include "socket.h" #include "socket.h"
#include "logger.h" #include "logger.h"
#include "class.h" #include "class.h"
#include "interface/logger.h"
static static
int int

2
src/socket/accept.c

@ -25,7 +25,7 @@
#include "socket.h" #include "socket.h"
#include "class.h" #include "class.h"
#include "interface/logger.h"
#include "logger.h"
Sock Sock
socketAccept(Sock this, char (*remoteAddr)[16]) socketAccept(Sock this, char (*remoteAddr)[16])

2
src/socket/connect.c

@ -25,7 +25,7 @@
#include "socket.h" #include "socket.h"
#include "class.h" #include "class.h"
#include "interface/logger.h"
#include "logger.h"
void void

2
src/socket/listen.c

@ -25,7 +25,7 @@
#include "socket.h" #include "socket.h"
#include "class.h" #include "class.h"
#include "interface/logger.h"
#include "logger.h"
void void

2
src/taskrambler.c

@ -41,7 +41,7 @@
#include "auth.h" #include "auth.h"
#include "class.h" #include "class.h"
#include "interface/logger.h"
#include "logger.h"
#include "utils/signalHandling.h" #include "utils/signalHandling.h"
#include "utils/memory.h" #include "utils/memory.h"

Loading…
Cancel
Save