Author: cazfi Date: Sun Jan 1 23:57:16 2017 New Revision: 34764 URL: http://svn.gna.org/viewcvs/freeciv?rev=34764&view=rev Log: Added log level LOG_WARN
See patch #7373 Modified: trunk/client/luascript/script_client.c trunk/client/luascript/script_client.h trunk/common/featured_text.c trunk/common/featured_text.h trunk/common/scriptcore/tolua_common_a.pkg trunk/doc/man/freeciv-client.6.in trunk/doc/man/freeciv-manual.6.in trunk/doc/man/freeciv-modpack.6.in trunk/doc/man/freeciv-server.6.in trunk/server/scripting/script_fcdb.c trunk/server/scripting/script_server.c trunk/utility/deprecations.c trunk/utility/deprecations.h trunk/utility/log.c trunk/utility/log.h Modified: trunk/client/luascript/script_client.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/luascript/script_client.c?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/client/luascript/script_client.c (original) +++ trunk/client/luascript/script_client.c Sun Jan 1 23:57:16 2017 @@ -249,6 +249,9 @@ case LOG_ERROR: ftc_luaconsole = ftc_luaconsole_error; break; + case LOG_WARN: + ftc_luaconsole = ftc_luaconsole_warn; + break; case LOG_NORMAL: ftc_luaconsole = ftc_luaconsole_normal; break; Modified: trunk/client/luascript/script_client.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/luascript/script_client.h?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/client/luascript/script_client.h (original) +++ trunk/client/luascript/script_client.h Sun Jan 1 23:57:16 2017 @@ -50,4 +50,3 @@ #endif /* __cplusplus */ #endif /* FC__SCRIPT_CLIENT_H */ - Modified: trunk/common/featured_text.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/featured_text.c?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/common/featured_text.c (original) +++ trunk/common/featured_text.c Sun Jan 1 23:57:16 2017 @@ -97,6 +97,7 @@ const struct ft_color ftc_luaconsole_input = FT_COLOR("#2B008B", NULL); const struct ft_color ftc_luaconsole_error = FT_COLOR("#FF0000", NULL); +const struct ft_color ftc_luaconsole_warn = FT_COLOR("#CF2020", NULL); const struct ft_color ftc_luaconsole_normal = FT_COLOR("#006400", NULL); const struct ft_color ftc_luaconsole_verbose = FT_COLOR("#B8B8B8", NULL); const struct ft_color ftc_luaconsole_debug = FT_COLOR("#B87676", NULL); Modified: trunk/common/featured_text.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/featured_text.h?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/common/featured_text.h (original) +++ trunk/common/featured_text.h Sun Jan 1 23:57:16 2017 @@ -192,6 +192,7 @@ extern const struct ft_color ftc_luaconsole_input; extern const struct ft_color ftc_luaconsole_error; +extern const struct ft_color ftc_luaconsole_warn; extern const struct ft_color ftc_luaconsole_normal; extern const struct ft_color ftc_luaconsole_verbose; extern const struct ft_color ftc_luaconsole_debug; Modified: trunk/common/scriptcore/tolua_common_a.pkg URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/scriptcore/tolua_common_a.pkg?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/common/scriptcore/tolua_common_a.pkg (original) +++ trunk/common/scriptcore/tolua_common_a.pkg Sun Jan 1 23:57:16 2017 @@ -59,6 +59,7 @@ enum log_level { LOG_FATAL @ FATAL, LOG_ERROR @ ERROR, + LOG_WARN @ WARN, LOG_NORMAL @ NORMAL, LOG_VERBOSE @ VERBOSE, LOG_DEBUG @ DEBUG @@ -81,6 +82,10 @@ function log.error(fmt, ...) log.base(log.level.ERROR, string.format(fmt, ...)) +end + +function log.warn(fmt, ...) + log.base(log.level.WARN, string.format(fmt, ...)) end function log.normal(fmt, ...) Modified: trunk/doc/man/freeciv-client.6.in URL: http://svn.gna.org/viewcvs/freeciv/trunk/doc/man/freeciv-client.6.in?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/doc/man/freeciv-client.6.in (original) +++ trunk/doc/man/freeciv-client.6.in Sun Jan 1 23:57:16 2017 @@ -117,9 +117,11 @@ \fB1\fP for fatal and error messages. -\fB2\fP for fatal, error and normal messages (default). - -\fB3\fP for fatal, error, normal, and verbose messages. +\fB2\fP for fatal, error and warning messages + +\fB3\fP for fatal, error, warning and normal messages (default). + +\fB4\fP for fatal, error, warning, normal, and verbose messages. .TP .BI "\-F [ \fIsignal_number\fP ], \-\-Fatal [ \fIsignal_number\fP ]" Modified: trunk/doc/man/freeciv-manual.6.in URL: http://svn.gna.org/viewcvs/freeciv/trunk/doc/man/freeciv-manual.6.in?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/doc/man/freeciv-manual.6.in (original) +++ trunk/doc/man/freeciv-manual.6.in Sun Jan 1 23:57:16 2017 @@ -7,7 +7,7 @@ [\fIoption \fR...] .TP \fB\-d\fR, \fB\-\-debug\fR NUM -Set debug log level (0 to 3) +Set debug log level (0 to 4) .TP \fB\-h\fR, \fB\-\-help\fR Print a summary of the options Modified: trunk/doc/man/freeciv-modpack.6.in URL: http://svn.gna.org/viewcvs/freeciv/trunk/doc/man/freeciv-modpack.6.in?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/doc/man/freeciv-modpack.6.in (original) +++ trunk/doc/man/freeciv-modpack.6.in Sun Jan 1 23:57:16 2017 @@ -66,9 +66,11 @@ \fB1\fP for fatal and error messages. -\fB2\fP for fatal, error and normal messages (default). +\fB2\fP for fatal, error and warning messages -\fB3\fP for fatal, error, normal, and verbose messages. +\fB3\fP for fatal, error, warning and normal messages (default). + +\fB4\fP for fatal, error, warning, normal, and verbose messages. .TP .BI "\-h, \-\-help" Modified: trunk/doc/man/freeciv-server.6.in URL: http://svn.gna.org/viewcvs/freeciv/trunk/doc/man/freeciv-server.6.in?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/doc/man/freeciv-server.6.in (original) +++ trunk/doc/man/freeciv-server.6.in Sun Jan 1 23:57:16 2017 @@ -110,9 +110,11 @@ \fB1\fP for fatal and error messages. -\fB2\fP for fatal, error and normal messages (default). - -\fB3\fP for fatal, error, normal, and verbose messages. +\fB2\fP for fatal, error and warning messages + +\fB3\fP for fatal, error, warning and normal messages (default). + +\fB4\fP for fatal, error, warning, normal, and verbose messages. .TP .BI "\-D \fIfilename\fP, \-\-Database \fIfilename\fP" Modified: trunk/server/scripting/script_fcdb.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/scripting/script_fcdb.c?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/server/scripting/script_fcdb.c (original) +++ trunk/server/scripting/script_fcdb.c Sun Jan 1 23:57:16 2017 @@ -157,6 +157,7 @@ log_fatal("%s", buf); break; case LOG_ERROR: + case LOG_WARN: rfc_status = C_WARNING; break; case LOG_NORMAL: Modified: trunk/server/scripting/script_server.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/scripting/script_server.c?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/server/scripting/script_server.c (original) +++ trunk/server/scripting/script_server.c Sun Jan 1 23:57:16 2017 @@ -499,6 +499,7 @@ log_fatal("%s", buf); break; case LOG_ERROR: + case LOG_WARN: rfc_status = C_WARNING; break; case LOG_NORMAL: Modified: trunk/utility/deprecations.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/utility/deprecations.c?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/utility/deprecations.c (original) +++ trunk/utility/deprecations.c Sun Jan 1 23:57:16 2017 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 Modified: trunk/utility/deprecations.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/utility/deprecations.h?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/utility/deprecations.h (original) +++ trunk/utility/deprecations.h Sun Jan 1 23:57:16 2017 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -23,7 +23,7 @@ typedef void (*deprecation_warn_callback)(const char *msg); -#define LOG_DEPRECATION LOG_NORMAL +#define LOG_DEPRECATION LOG_WARN void deprecation_warn_cb_set(deprecation_warn_callback new_cb); void deprecation_warnings_enable(void); Modified: trunk/utility/log.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/utility/log.c?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/utility/log.c (original) +++ trunk/utility/log.c Sun Jan 1 23:57:16 2017 @@ -65,7 +65,7 @@ #endif /* FREECIV_DEBUG */ static char *log_level_names[] = { - "Fatal", "Error", "Normal", "Verbose", "Debug", NULL + "Fatal", "Error", "Warning", "Normal", "Verbose", "Debug", NULL }; /* A helper variable to indicate that there is no log message. The '%s' is Modified: trunk/utility/log.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/utility/log.h?rev=34764&r1=34763&r2=34764&view=diff ============================================================================== --- trunk/utility/log.h (original) +++ trunk/utility/log.h Sun Jan 1 23:57:16 2017 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -25,6 +25,7 @@ enum log_level { LOG_FATAL = 0, LOG_ERROR, /* non-fatal errors */ + LOG_WARN, LOG_NORMAL, LOG_VERBOSE, /* not shown by default */ LOG_DEBUG /* suppressed unless DEBUG defined */ @@ -98,6 +99,8 @@ LOG_FATAL, message, ## __VA_ARGS__); #define log_error(message, ...) \ log_base(LOG_ERROR, message, ## __VA_ARGS__) +#define log_warn(message, ...) \ + log_base(LOG_WARN, message, ## __VA_ARGS__) #define log_normal(message, ...) \ log_base(LOG_NORMAL, message, ## __VA_ARGS__) #define log_verbose(message, ...) \ _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits