myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [3055] Do not use a special syntax to define values fo


From: Giuseppe Scrivano
Subject: [myserver-commit] [3055] Do not use a special syntax to define values for log colours.
Date: Thu, 23 Apr 2009 21:20:49 +0000

Revision: 3055
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3055
Author:   gscrivano
Date:     2009-04-23 21:20:47 +0000 (Thu, 23 Apr 2009)
Log Message:
-----------
Do not use a special syntax to define values for log colours.

Modified Paths:
--------------
    trunk/myserver/binaries/myserver.default.windows.xml
    trunk/myserver/binaries/myserver.default.xml
    trunk/myserver/documentation/log_management.texi
    trunk/myserver/src/server/server.cpp

Modified: trunk/myserver/binaries/myserver.default.windows.xml
===================================================================
--- trunk/myserver/binaries/myserver.default.windows.xml        2009-04-20 
19:20:26 UTC (rev 3054)
+++ trunk/myserver/binaries/myserver.default.windows.xml        2009-04-23 
21:20:47 UTC (rev 3055)
@@ -50,10 +50,16 @@
        <!--DEFINE THE MAX NUMBER OF CONNECTIONS TO ACCEPT.-->
        <DEFINE name="server.max_accepted_connections" value="0" />
 
-  <!-- TEXT AND BACKGROUND ATTRIBUTES FOR CONSOLE LOG MESSAGES. -->
-  <CONSOLE_COLORS info_fg="white" info_bg="black" warning_fg="yellow" 
-                  warning_bg="black" error_fg="red" error_bg="black"/>
+  <!--TEXT AND BACKGROUND ATTRIBUTES FOR CONSOLE LOG MESSAGES. -->
+  <DEFINE name="log_color.info_fg" value="white" />
+  <DEFINE name="log_color.info_bg" value="black" />
 
+  <DEFINE name="log_color.warning_fg" value="yellow" />
+  <DEFINE name="log_color.warning_bg" value="black" />
+
+  <DEFINE name="log_color.error_fg" value="red" />
+  <DEFINE name="log_color.error_bg" value="black" />
+
        <!--MAX SIZE OF THE LOG FILE IN BYTES   -->
        <DEFINE name="server.max_log_size" value="1048576" />
 

Modified: trunk/myserver/binaries/myserver.default.xml
===================================================================
--- trunk/myserver/binaries/myserver.default.xml        2009-04-20 19:20:26 UTC 
(rev 3054)
+++ trunk/myserver/binaries/myserver.default.xml        2009-04-23 21:20:47 UTC 
(rev 3055)
@@ -50,10 +50,16 @@
        <!--DEFINE THE MAX NUMBER OF CONNECTIONS TO ACCEPT.-->
        <DEFINE name="server.max_accepted_connections" value="0" />
 
-  <!-- TEXT AND BACKGROUND ATTRIBUTES FOR CONSOLE LOG MESSAGES. -->
-  <CONSOLE_COLORS info_fg="white" info_bg="black" warning_fg="yellow" 
-                  warning_bg="black" error_fg="red" error_bg="black"/>
+  <!--TEXT AND BACKGROUND ATTRIBUTES FOR CONSOLE LOG MESSAGES. -->
+  <DEFINE name="log_color.info_fg" value="white" />
+  <DEFINE name="log_color.info_bg" value="black" />
 
+  <DEFINE name="log_color.warning_fg" value="yellow" />
+  <DEFINE name="log_color.warning_bg" value="black" />
+
+  <DEFINE name="log_color.error_fg" value="red" />
+  <DEFINE name="log_color.error_bg" value="black" />
+
        <!--MAX SIZE OF THE LOG FILE IN BYTES   -->
        <DEFINE name="server.max_log_size" value="1048576" />
 

Modified: trunk/myserver/documentation/log_management.texi
===================================================================
--- trunk/myserver/documentation/log_management.texi    2009-04-20 19:20:26 UTC 
(rev 3054)
+++ trunk/myserver/documentation/log_management.texi    2009-04-23 21:20:47 UTC 
(rev 3055)
@@ -104,8 +104,14 @@
 editing the @file{myserver.xml} configuration file and adding the
 following code:
 @example
-<CONSOLE_COLORS info_fg="white" info_bg="black" warning_fg="yellow" 
-                warning_bg="black" error_fg="red" error_bg="black"/>
+  <DEFINE name="log_color.info_fg" value="white">
+  <DEFINE name="log_color.info_bg" value="black">
+
+  <DEFINE name="log_color.warning_fg" value="yellow">
+  <DEFINE name="log_color.warning_bg" value="black">
+
+  <DEFINE name="log_color.error_fg" value="red">
+  <DEFINE name="log_color.error_bg" value="black">
 @end example
 Allowed values for colors are @code{black}, @code{red}, @code{green},
 @code{yellow}, @code{blue}, @code{magenta}, @code{cyan} and
@@ -113,5 +119,5 @@
 respectively the foreground attribute and the background one, while the
 three prefixes, @code{info}, @code{warning} and @code{error} represent
 kinds of logging messages managed by MyServer.
-If the @code{CONSOLE_COLORS} information is missing or it is partially
+If the console colours information is missing or it is partially
 provided, MyServer will use default values.

Modified: trunk/myserver/src/server/server.cpp
===================================================================
--- trunk/myserver/src/server/server.cpp        2009-04-20 19:20:26 UTC (rev 
3054)
+++ trunk/myserver/src/server/server.cpp        2009-04-23 21:20:47 UTC (rev 
3055)
@@ -1006,12 +1006,16 @@
     {
       string fg (*it + "_fg");
       string bg (*it + "_bg");
-      data = configurationFileManager.getAttr ("CONSOLE_COLORS", fg.c_str ());
+
+      string fullFg ("log_color." + *it + "_fg");
+      string fullBg ("log_color." + *it + "_bg");
+      data = getHashedData (fullFg.c_str ());
       if (data)
         {
           consoleColors[fg] = string (data);
         }
-      data = configurationFileManager.getAttr ("CONSOLE_COLORS", bg.c_str ());
+
+      data = getHashedData (fullBg.c_str ());
       if (data)
         {
           consoleColors[bg] = string (data);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]