--- freem/src/global_bltin.c 2025/04/13 04:22:43 1.22 +++ freem/src/global_bltin.c 2025/04/17 14:34:27 1.23 @@ -1,5 +1,5 @@ /* - * $Id: global_bltin.c,v 1.22 2025/04/13 04:22:43 snw Exp $ + * $Id: global_bltin.c,v 1.23 2025/04/17 14:34:27 snw Exp $ * freem database engine * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: global_bltin.c,v $ + * Revision 1.23 2025/04/17 14:34:27 snw + * Further logging improvements + * * Revision 1.22 2025/04/13 04:22:43 snw * Fix snprintf calls * @@ -97,6 +100,7 @@ #include "mpsdef.h" #include "journal.h" #include "global_bltin.h" +#include "log.h" global_handle *global_handles_head; unsigned long gbl_cache_misses = 0; @@ -437,13 +441,11 @@ short gbl_open(global_handle *g, short a switch (result) { case GBL_HDR_BADMAGIC: - fprintf (stderr, "gbl_open: bad magic value in %s [FATAL]\n", g->global_name); - exit (1); + logprintf (FM_LOG_FATAL, "gbl_open: bad magic value in %s", g->global_name); break; case GBL_HDR_BADVERSION: - fprintf (stderr, "gbl_open: global version is %d in %s (must be %d) [FATAL]\n", g->header.format_version, g->global_name, GBL_FORMAT_VERSION); - exit (1); + logprintf (FM_LOG_FATAL, "gbl_open: global version is %d in %s (must be %d)", g->header.format_version, g->global_name, GBL_FORMAT_VERSION); break; } @@ -3606,27 +3608,13 @@ void close_all_globals (void) gbl_close_all (); return; -} /* end close_all_globals() */ +} /* close_all_globals() */ static void panic (void) { - printf ("write failed\r\n"); - - printf ("\033[s\033[25H\033[5;7mwrite needs more disk space immediately\007"); - sleep (1); - printf ("\033[m\007\033[2K\033[u"); - - /* restore screen 'cause system messed up screen */ - -#ifdef NOWRITEM - - write_m ("\033[4~\201"); - -#endif /* NOWRITEM */ - + logprintf (FM_LOG_ERROR, "global_bltin: could not write to full disk"); return; - -} /* end panic() */ +} /* panic() */ void gbl_dump_stat(void)