[Freeciv-Dev] Re: (PR#6305) New server command: debug
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] Re: (PR#6305) New server command: debug |
From: |
"Per I. Mathisen" <per@xxxxxxxxxxx> |
Date: |
Sat, 27 Sep 2003 16:09:55 -0700 |
Reply-to: |
rt@xxxxxxxxxxxxxx |
Attached patch removes the now defunct and unused GOTO_LOG() function.
- Per
Index: ai/ailog.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/ailog.c,v
retrieving revision 1.7
diff -u -r1.7 ailog.c
--- ai/ailog.c 17 Jul 2003 18:56:50 -0000 1.7
+++ ai/ailog.c 27 Sep 2003 23:09:11 -0000
@@ -40,7 +40,9 @@
va_list ap;
int minlevel = MIN(LOGLEVEL_CITY, level);
- if (minlevel > fc_log_level) {
+ if (pcity->debug) {
+ minlevel = LOG_NORMAL;
+ } else if (minlevel > fc_log_level) {
return;
}
@@ -70,7 +72,9 @@
int minlevel = MIN(LOGLEVEL_UNIT, level);
int gx, gy;
- if (minlevel > fc_log_level) {
+ if (punit->debug) {
+ minlevel = LOG_NORMAL;
+ } else if (minlevel > fc_log_level) {
return;
}
@@ -96,44 +100,6 @@
}
/**************************************************************************
- Log goto message if the goto fails. They will appear like this
- 2: a's Explorer[105] on GOTO (3,25)->(5,23) failed : exploring territory
-**************************************************************************/
-void GOTO_LOG(int level, struct unit *punit, enum goto_result result,
- const char *msg, ...)
-{
- int minlevel = MIN(LOGLEVEL_GOTO, level);
-
- if (minlevel <= fc_log_level && (result == GR_FAILED || result ==
GR_FOUGHT)) {
- char buffer[500];
- char buffer2[500];
- va_list ap;
- int gx, gy;
-
- if (is_goto_dest_set(punit)) {
- gx = goto_dest_x(punit);
- gy = goto_dest_y(punit);
- } else {
- gx = gy = -1;
- }
-
- my_snprintf(buffer, sizeof(buffer),
- "%s's %s[%d] on GOTO (%d,%d)->(%d,%d) %s : ",
- unit_owner(punit)->name, unit_type(punit)->name,
- punit->id, punit->x, punit->y,
- gx, gy,
- (result == GR_FAILED) ? "failed" : "fought");
-
- va_start(ap, msg);
- my_vsnprintf(buffer2, sizeof(buffer2), msg, ap);
- va_end(ap);
-
- cat_snprintf(buffer, sizeof(buffer), buffer2);
- freelog(minlevel, buffer);
- }
-}
-
-/**************************************************************************
Log message for bodyguards. They will appear like this
2: ai4's bodyguard Mech. Inf.[485] (38,22){Riflemen:574@37,23} was ...
note that these messages are likely to wrap if long.
@@ -147,7 +113,9 @@
int x = -1, y = -1, id = -1;
const char *s = "none";
- if (minlevel > fc_log_level) {
+ if (punit->debug) {
+ minlevel = LOG_NORMAL;
+ } else if (minlevel > fc_log_level) {
return;
}
Index: ai/ailog.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/ailog.h,v
retrieving revision 1.3
diff -u -r1.3 ailog.h
--- ai/ailog.h 15 Nov 2002 22:15:01 -0000 1.3
+++ ai/ailog.h 27 Sep 2003 23:09:11 -0000
@@ -30,8 +30,6 @@
void CITY_LOG(int level, struct city *pcity, const char *msg, ...);
void UNIT_LOG(int level, struct unit *punit, const char *msg, ...);
-void GOTO_LOG(int level, struct unit *punit, enum goto_result result,
- const char *msg, ...);
void BODYGUARD_LOG(int level, struct unit *punit, const char *msg);
#endif /* FC__AILOG_H */
- [Freeciv-Dev] Re: (PR#6305) New server command: debug,
Per I. Mathisen <=
|
|