forked from github/server
reduce warning level on oldterrain() log, warn from caller (json_report) instead.
This commit is contained in:
parent
2df0743439
commit
1dc516ab50
|
@ -1,9 +1,11 @@
|
||||||
#include "reports.h"
|
#include "reports.h"
|
||||||
#include "jsreport.h"
|
#include "jsreport.h"
|
||||||
#include "kernel/region.h"
|
#include <kernel/region.h>
|
||||||
#include "kernel/terrain.h"
|
#include <kernel/terrain.h>
|
||||||
#include "kernel/terrainid.h"
|
#include <kernel/terrainid.h>
|
||||||
#include "kernel/config.h"
|
#include <kernel/config.h>
|
||||||
|
|
||||||
|
#include <util/log.h>
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -56,6 +58,9 @@ static int report_json(const char *filename, report_context * ctx, const char *c
|
||||||
sr = find_seen(ctx->seen, r);
|
sr = find_seen(ctx->seen, r);
|
||||||
if (sr) {
|
if (sr) {
|
||||||
terrain_t ter = oldterrain(r->terrain);
|
terrain_t ter = oldterrain(r->terrain);
|
||||||
|
if (ter != NOTERRAIN) {
|
||||||
|
log_warning("report_json: %s has no terrain id\n", r->terrain->_name);
|
||||||
|
}
|
||||||
data = 1 + (int)ter;
|
data = 1 + (int)ter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,7 @@ terrain_t oldterrain(const struct terrain_type * terrain)
|
||||||
if (newterrains[t] == terrain)
|
if (newterrains[t] == terrain)
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
log_warning("%s is not a classic terrain.\n", terrain->_name);
|
log_debug("%s is not a classic terrain.\n", terrain->_name);
|
||||||
return NOTERRAIN;
|
return NOTERRAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ extern "C" {
|
||||||
extern void log_flush(void);
|
extern void log_flush(void);
|
||||||
|
|
||||||
/* use macros above instead of these: */
|
/* use macros above instead of these: */
|
||||||
extern void log_warning(const char *format, ...);
|
|
||||||
extern void log_error(const char *format, ...);
|
extern void log_error(const char *format, ...);
|
||||||
|
extern void log_warning(const char *format, ...);
|
||||||
extern void log_debug(const char *format, ...);
|
extern void log_debug(const char *format, ...);
|
||||||
extern void log_info(const char *format, ...);
|
extern void log_info(const char *format, ...);
|
||||||
extern void log_printf(FILE * ios, const char *format, ...);
|
extern void log_printf(FILE * ios, const char *format, ...);
|
||||||
|
|
Loading…
Reference in New Issue