blob: 35e09e157cfd397b680c0774b0f6126f9a951a4a [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstrad59c3892019-11-28 20:53:39 +01002 #include <debug_message.h>
MG Mud User88f12472016-06-24 23:31:02 +02003
Zesstrad59c3892019-11-28 20:53:39 +01004 void debug_message(string text)
5 void debug_message(string text, int flags)
MG Mud User88f12472016-06-24 23:31:02 +02006
Zesstra715ec202025-07-09 22:18:31 +02007DESCRIPTION
8 Prints the given text to stdout, stderr, the <host>.debug.log file,
9 or any combination of these.
MG Mud User88f12472016-06-24 23:31:02 +020010
Zesstra715ec202025-07-09 22:18:31 +020011 The parameter <flags> is a combination of bitflags determining the
12 target and the mode of writing.
MG Mud User88f12472016-06-24 23:31:02 +020013
Zesstra715ec202025-07-09 22:18:31 +020014 The target flags are: DMSG_STDOUT, DMSG_STDERR and DMSG_LOGFILE.
15 If the flag DMSG_STAMP is given, the message is prepended with the
16 current date and time in the format 'YYYY.MM.DD HH:MM:SS '.
MG Mud User88f12472016-06-24 23:31:02 +020017
Zesstra715ec202025-07-09 22:18:31 +020018 If <flags> is given as 0, left out, or contains no target
19 definition, debug_message() will print to stdout and to the logfile.
MG Mud User88f12472016-06-24 23:31:02 +020020
Zesstrad59c3892019-11-28 20:53:39 +010021
Zesstra715ec202025-07-09 22:18:31 +020022EXAMPLES
23 debug_message("This goes to stdout and the logfile.\n");
24 debug_message("This goes to stderr.\n", DMSG_STDERR);
25 debug_message("This goes to stdout and stderr.\n"
26 , DMSG_STDOUT | DMSG_STDERR);
MG Mud User88f12472016-06-24 23:31:02 +020027
Zesstra715ec202025-07-09 22:18:31 +020028 debug_message("This goes to stdout and the logfile, with timestamp.\n"
29 , DMSG_STAMP);
30 debug_message("This goes to stdout and has the timestamp in front.\n"
31 , DMSG_STDOUT | DMSG_STAMP);
MG Mud User88f12472016-06-24 23:31:02 +020032
Zesstra715ec202025-07-09 22:18:31 +020033HISTORY
34 Introduced in 3.2.1@34.
35 LDMud 3.2.9 introduced the <flags> parameter.
36
37SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020038 last_instructions(E)