mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-24 07:10:36 +02:00
util: allow GALLIUM_LOG_FILE=stdout
To log gallium info to stdout instead of a file. Signed-off-by: Brian Paul <brianp@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213>
This commit is contained in:
parent
69f7c91fe9
commit
2967cc25ea
1 changed files with 11 additions and 7 deletions
|
|
@ -86,15 +86,19 @@ os_log_message(const char *message)
|
|||
/* one-time init */
|
||||
const char *filename = os_get_option("GALLIUM_LOG_FILE");
|
||||
if (filename) {
|
||||
const char *mode = "w";
|
||||
if (filename[0] == '+') {
|
||||
/* If the filename is prefixed with '+' then open the file for
|
||||
* appending instead of normal writing.
|
||||
*/
|
||||
mode = "a";
|
||||
if (strcmp(filename, "stdout") == 0) {
|
||||
fout = stdout;
|
||||
} else {
|
||||
const char *mode = "w";
|
||||
if (filename[0] == '+') {
|
||||
/* If the filename is prefixed with '+' then open the file for
|
||||
* appending instead of normal writing.
|
||||
*/
|
||||
mode = "a";
|
||||
filename++; /* skip the '+' */
|
||||
}
|
||||
fout = fopen(filename, mode);
|
||||
}
|
||||
fout = fopen(filename, mode);
|
||||
}
|
||||
#endif
|
||||
if (!fout)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue