Open the given file for writing and duplicate its file descriptor to be used for stdout and stderr.
This has the effect of closing the previous stdout and stderr, and sending all messages that would have gone there to the given file instead.
By default the file is truncated and hence overwritten each time the process is executed. Since version 0.7.14, if the filename is prefixed with '+' then the file is not truncated and output is added at the end of the file.
Passing null
to this function is guaranteed to have no effect. This is so you can call it with the recommended usage
tp_debug_divert_messages (g_getenv ("MYAPP_LOGFILE")) and it won't do anything if the environment variable is not set.
This function still works if telepathy-glib was compiled without debug support.
filename |
A file to which to divert stdout and stderr, or |