37 const char *
where,
const char *msg);
67 "Fatal",
"Error",
"Warning",
"Normal",
"Verbose",
"Debug",
nullptr
102 while ((c =
strchr(c,
':'))) {
125 " Use one of the levels Fatal, Error, Warning, Normal, Verbose, Debug") );
138 _(
"Freeciv must be compiled with the FREECIV_DEBUG flag "
139 "to use debug level %d.\n"),
max_level + 1);
196 if (d && *
pc !=
'\0' && d[1] !=
'\0') {
233 _(
"Freeciv must be compiled with the FREECIV_DEBUG flag "
234 "to use advanced log levels based on files.\n"));
254 if (filename &&
strlen(filename) > 0) {
345 const char *file,
int line)
431 const char *
where,
const char *msg)
435 static unsigned int next = 2;
436 static unsigned int prev = 0;
446 _(
"Couldn't open logfile: %s for appending \"%s\".\n"),
459 PL_(
"last message repeated %d time",
460 "last message repeated %d times",
465 PL_(
" (total %d repeat)",
466 " (total %d repeats)",
480 PL_(
"last message repeated %d time",
481 "last message repeated %d times",
485 PL_(
" (total %d repeat)",
" (total %d repeats)",
536#ifndef FREECIV_NDEBUG
564 _(
"Please report this message at %s"),
BUG_URL);
void deprecation_pending(const char *format,...)
void fc_fprintf(FILE *stream, const char *format,...) fc__attribute((__format__(__printf__
#define PL_(String1, String2, n)
void fc_mutex_allocate(fc_mutex *mutex)
void fc_mutex_init(fc_mutex *mutex)
void fc_mutex_release(fc_mutex *mutex)
void fc_mutex_destroy(fc_mutex *mutex)
void fc_assert_fail(const char *file, const char *function, int line, const char *assertion, const char *message,...)
static log_pre_callback_fn log_pre_callback
static enum log_level max_level
static void log_real(enum log_level level, bool print_from_where, const char *where, const char *msg)
void log_init(const char *filename, enum log_level initial_level, log_callback_fn callback, log_prefix_fn prefix, int fatal_assertions)
static char * log_level_names[]
static char * log_filename
void fc_assert_set_fatal(int fatal_assertions)
static log_callback_fn log_callback
void log_set_level(enum log_level level)
log_callback_fn log_set_callback(log_callback_fn callback)
const char * log_level_name(enum log_level lvl)
static void log_write(FILE *fs, enum log_level level, bool print_from_where, const char *where, const char *message)
log_pre_callback_fn log_set_pre_callback(log_pre_callback_fn precallback)
void vdo_log(const char *file, const char *function, int line, bool print_from_where, enum log_level level, char *buf, int buflen, const char *message, va_list args)
static int fc_fatal_assertions
bool log_parse_level_str(const char *level_str, enum log_level *ret_level)
log_prefix_fn log_set_prefix(log_prefix_fn prefix)
void do_log(const char *file, const char *function, int line, bool print_from_where, enum log_level level, const char *message,...)
static log_prefix_fn log_prefix
enum log_level log_get_level(void)
static enum log_level fc_log_level
static fc_mutex logfile_mutex
const char *(* log_prefix_fn)(void)
void(* log_callback_fn)(enum log_level, const char *, bool file_too)
#define log_verbose(message,...)
void(* log_pre_callback_fn)(enum log_level, bool print_from_where, const char *where, const char *msg)
#define log_debug(message,...)
#define fc_realloc(ptr, sz)
static int fatal_assertions
struct setting_list * level[OLEVELS_NUM]
bool str_to_uint(const char *str, unsigned int *pint)
int fc_snprintf(char *str, size_t n, const char *format,...)
int cat_snprintf(char *str, size_t n, const char *format,...)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
FILE * fc_fopen(const char *filename, const char *opentype)
int fc_strncasecmp(const char *str0, const char *str1, size_t n)
#define sz_strlcpy(dest, src)
#define fc_strncmp(_s1_, _s2_, _len_)