Home of logprintf.
More...
#include "log.h"
#include "conf.h"
#include "ndata.h"
#include "nstring.h"
Go to the source code of this file.
|
| static void | log_copy (int enable) |
| | Sets up or terminates copying of standard streams into memory.
|
| |
| static void | log_append (FILE *stream, char *str) |
| | Appends a message to a stream's in-memory buffer.
|
| |
| static void | log_cleanStream (PHYSFS_File **file, const char *fname, const char *filedouble) |
| |
| static void | log_purge (void) |
| | Deletes copied output without printing the contents.
|
| |
| int | logprintf (FILE *stream, int newline, const char *fmt,...) |
| | Like fprintf, but automatically teed to log files (and line-terminated if newline is true).
|
| |
| void | log_redirect (void) |
| | Sets up redirection of stdout and stderr to files. PhysicsFS must be initialized for this to work.
|
| |
| void | log_init (void) |
| | Sets up the logging subsystem. (Calling this ensures logging output is preserved until we have a place to save it. That happens after we set up PhysicsFS and call log_redirect().)
|
| |
| void | log_clean (void) |
| | Deletes useless (empty) log files from the current session.
|
| |
Home of logprintf.
Definition in file log.c.
◆ log_append()
| static void log_append |
( |
FILE * | stream, |
|
|
char * | str ) |
|
static |
Appends a message to a stream's in-memory buffer.
- Parameters
-
| stream | Destination stream (stdout or stderr) |
| str | String to append. |
Definition at line 239 of file log.c.
◆ log_clean()
Deletes useless (empty) log files from the current session.
Definition at line 205 of file log.c.
◆ log_cleanStream()
| static void log_cleanStream |
( |
PHYSFS_File ** | file, |
|
|
const char * | fname, |
|
|
const char * | filedouble ) |
|
static |
◆ log_copy()
| void log_copy |
( |
int | enable | ) |
|
|
static |
Sets up or terminates copying of standard streams into memory.
While copying is active, all stdout and stderr-bound messages that pass through logprintf will also be put into a buffer in memory, to be flushed when copying is disabled.
- Parameters
-
| enable | Whether to enable or disable copying. Disabling flushes logs. |
Definition at line 156 of file log.c.
◆ log_init()
Sets up the logging subsystem. (Calling this ensures logging output is preserved until we have a place to save it. That happens after we set up PhysicsFS and call log_redirect().)
- See also
- log_copy
Definition at line 142 of file log.c.
◆ log_purge()
| static void log_purge |
( |
void | | ) |
|
|
static |
Deletes copied output without printing the contents.
Definition at line 188 of file log.c.
◆ log_redirect()
| void log_redirect |
( |
void | | ) |
|
Sets up redirection of stdout and stderr to files. PhysicsFS must be initialized for this to work.
Definition at line 108 of file log.c.
◆ logprintf()
| int logprintf |
( |
FILE * | stream, |
|
|
int | newline, |
|
|
const char * | fmt, |
|
|
| ... ) |
Like fprintf, but automatically teed to log files (and line-terminated if newline is true).
Definition at line 56 of file log.c.
◆ copying
Definition at line 39 of file log.c.
◆ errcopy
Definition at line 26 of file log.c.
◆ errfiledouble
| char* errfiledouble = NULL |
|
static |
Definition at line 36 of file log.c.
◆ logerr_file
| PHYSFS_File* logerr_file = NULL |
|
static |
Definition at line 43 of file log.c.
◆ logout_file
| PHYSFS_File* logout_file = NULL |
|
static |
Definition at line 42 of file log.c.
◆ merrcopy
Definition at line 29 of file log.c.
◆ moutcopy
Definition at line 28 of file log.c.
◆ nerrcopy
Definition at line 32 of file log.c.
◆ noutcopy
Definition at line 31 of file log.c.
◆ outcopy
< Temporary storage buffers.
Definition at line 25 of file log.c.
◆ outfiledouble
| char* outfiledouble = NULL |
|
static |
< Output filenames for stdout and stderr.
Definition at line 35 of file log.c.