[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r4902 - in GNUnet: . src/include src/server src/util/boot
From: |
gnunet |
Subject: |
[GNUnet-SVN] r4902 - in GNUnet: . src/include src/server src/util/boot |
Date: |
Sat, 2 Jun 2007 16:22:18 -0600 (MDT) |
Author: grothoff
Date: 2007-06-02 16:22:18 -0600 (Sat, 02 Jun 2007)
New Revision: 4902
Modified:
GNUnet/src/include/gnunet_util_error.h
GNUnet/src/server/gnunetd.c
GNUnet/src/util/boot/startup.c
GNUnet/todo
Log:
better logging code
Modified: GNUnet/src/include/gnunet_util_error.h
===================================================================
--- GNUnet/src/include/gnunet_util_error.h 2007-06-02 21:53:30 UTC (rev
4901)
+++ GNUnet/src/include/gnunet_util_error.h 2007-06-02 22:22:18 UTC (rev
4902)
@@ -50,12 +50,12 @@
typedef enum {
GE_NOTHING = 0x00000000,
/* type of event */
- GE_DEBUG = 0x00000001, /* DEBUG/CRON/EVERYTHING */
- GE_STATUS = 0x00000002, /* status message */
- GE_INFO = 0x00000004, /* normal program response */
- GE_WARNING = 0x00000008,
- GE_ERROR = 0x00000010,
- GE_FATAL = 0x00000020, /* FATAL/FAILURE/NOTHING */
+ GE_FATAL = 0x00000001, /* FATAL/FAILURE/NOTHING */
+ GE_ERROR = 0x00000002,
+ GE_WARNING = 0x00000004,
+ GE_INFO = 0x00000008, /* normal program response */
+ GE_STATUS = 0x00000010, /* status message */
+ GE_DEBUG = 0x00000020, /* DEBUG/CRON/EVERYTHING */
GE_EVENTKIND = 0x000000FF, /* bitmask */
/* who should see the message? */
Modified: GNUnet/src/server/gnunetd.c
===================================================================
--- GNUnet/src/server/gnunetd.c 2007-06-02 21:53:30 UTC (rev 4901)
+++ GNUnet/src/server/gnunetd.c 2007-06-02 22:22:18 UTC (rev 4902)
@@ -250,15 +250,32 @@
return 1;
}
if (YES == debug_flag) {
+ int dev;
+ char * user_log_level;
+ GE_KIND ull;
+
GE_setDefaultContext(NULL);
GE_free_context(ectx);
+ GC_get_configuration_value_string(cfg,
+ "LOGGING",
+ "USER-LEVEL",
+ "WARNING",
+ &user_log_level);
+ dev = GC_get_configuration_value_yesno(cfg,
+ "LOGGING",
+ "DEVELOPER",
+ NO);
+ ull = GE_getKIND(user_log_level);
+ ull |= (ull - 1); /* set bits for all lower log-levels */
+ if (dev == YES)
+ ull |= GE_DEVELOPER | GE_REQUEST;
if (loud_flag == 1)
ectx = GE_create_context_stderr(YES,
GE_ALL);
else
ectx = GE_create_context_stderr(YES,
GE_USER | GE_ADMIN
- | GE_WARNING | GE_ERROR | GE_FATAL
+ | ull
| GE_BULK | GE_IMMEDIATE);
GE_setDefaultContext(ectx);
}
Modified: GNUnet/src/util/boot/startup.c
===================================================================
--- GNUnet/src/util/boot/startup.c 2007-06-02 21:53:30 UTC (rev 4901)
+++ GNUnet/src/util/boot/startup.c 2007-06-02 22:22:18 UTC (rev 4902)
@@ -66,6 +66,7 @@
struct GE_Context * nctx;
struct GE_Context * tetx;
unsigned long long logrotate;
+ int dev;
nctx = NULL;
admin_log_file = NULL;
@@ -97,13 +98,24 @@
"USER-LEVEL",
"WARNING",
&user_log_level);
+ dev = GC_get_configuration_value_yesno(cfg,
+ "LOGGING",
+ "DEVELOPER",
+ NO);
all = convertLogLevel(admin_log_level);
ull = convertLogLevel(user_log_level);
+ if (dev == YES) {
+ all |= GE_DEVELOPER | GE_REQUEST;
+ ull |= GE_DEVELOPER | GE_REQUEST;
+ }
FREE(admin_log_level);
FREE(user_log_level);
if (all != 0) {
nctx = GE_create_context_logfile(NULL,
- all | GE_ADMIN | GE_BULK | GE_IMMEDIATE,
+ all
+ | GE_ADMIN
+ | GE_BULK
+ | GE_IMMEDIATE,
admin_log_file,
YES,
(int) logrotate);
Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2007-06-02 21:53:30 UTC (rev 4901)
+++ GNUnet/todo 2007-06-02 22:22:18 UTC (rev 4902)
@@ -15,7 +15,6 @@
- new features:
* HTTP transport (libcurl, libmicrohttpd) [#765] [likely 0.7.2a]
-
0.7.3 [7'07] (aka "features"):
- Chat support basics [RC]
- insert meta-data under hash (md5? sha1? sha-512? GNUnet-URI?)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r4902 - in GNUnet: . src/include src/server src/util/boot,
gnunet <=