From 668d1d525509604ab4ccd7382022dfb469c99841 Mon Sep 17 00:00:00 2001
From: Dirk Zimoch 5. Debug and Error Messages
Generation of debug and error messages is controlled with two shell variables,
streamDebug
and streamError
.
Setting those variables to 1 (actually to any number but 0) enables the
-messages.
+messages. A few noisy and rarely useful debug messages are only enabled when
+setting streamDebug
to 2.
Per default debug messages are switched off and error messages are switched on.
Errors occuring while loading protocol files are always shown.
-Warning: Enabling debug messages can create a lot of output!
-At the moment, there is no way to set filters on debug or error messages.
+Warning: Enabling debug messages this way can create a lot of output!
+Therefore, some limited debugging can be enabled per record, independent of
+the streamDebug
variable using the .TPRO
field of
+the record. Currently, setting .TPRO
to 1 or 2 enables some
+basic information about the processing of a record and its i/o.
Debug output can be redirected to a file with the command
streamSetLogfile("filename")
.
-When called without a filename, debug output is directed back
-to the console.
+If the file already exists, it will be overwritten, not appended to.
+While debug messages are only written to the defined log file, error messages
+are still printed to stderr too.
+Calling streamSetLogfile
without a filename directs debug output
+back to stderr and closes the log file.
-By default the debug/error output is set to be colored if the terminal allows
-it but this can be set to always colored or never colored by setting
-streamDebugColored
to 1 or 0 respectively.
+By default, error messages to the console are printed in red color if
+stderr is a tty at startup time, using ANSI color codes. Some
+terminals may not support this properly.
+The variable streamDebugColored
can be set to 0 or 1 to
+disable or enable colored error messages explicitly.
+Error messages written to a log file do not use colors.
Error and debug messages are prefixed with a time stamp unless the variable
streamMsgTimeStamped
is set to 0.
-When a device is disconnected StreamDevice can produce many repeated timeout
-messages. To reduce this logging you can set streamErrorDeadTime
-to an integer number of seconds. When this is set repeated timeout messages
-will not be printed in the specified dead time after the last message. The
-default dead time is 0, resulting in every message being printed.
+when a device is unresponsive, StreamDevice may produce many repeated timeout
+messages. To reduce this, you can set streamErrorDeadTime
+to an integer number of seconds. In this case, repeated timeout messages
+will not be printed during the specified dead time after the last printed
+message. The default dead time is 0, resulting in every message being printed.