diff options
author | taiyu <taiyu.len@gmail.com> | 2015-08-23 12:34:18 -0700 |
---|---|---|
committer | taiyu <taiyu.len@gmail.com> | 2015-08-23 12:34:18 -0700 |
commit | 51ab3c918030565cefbb82dc8e899f324e6c5a21 (patch) | |
tree | 1a9e633ead0ff50f55987310621dab39531d2305 /sway/log.c | |
parent | d72cc925416847adaf2636cea0773ef6d9a46461 (diff) | |
parent | 1ac0c8cd47f734809c20bf6a6a0a7278680ed597 (diff) |
merge
Diffstat (limited to 'sway/log.c')
-rw-r--r-- | sway/log.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -53,7 +53,7 @@ void sway_log(log_importance_t verbosity, const char* format, ...) { c = sizeof(verbosity_colors) / sizeof(char *) - 1; } - if (colored) { + if (colored && isatty(STDERR_FILENO)) { fprintf(stderr, "%s", verbosity_colors[c]); } @@ -62,7 +62,7 @@ void sway_log(log_importance_t verbosity, const char* format, ...) { vfprintf(stderr, format, args); va_end(args); - if (colored) { + if (colored && isatty(STDERR_FILENO)) { fprintf(stderr, "\x1B[0m"); } fprintf(stderr, "\n"); @@ -76,7 +76,7 @@ void sway_log_errno(log_importance_t verbosity, char* format, ...) { c = sizeof(verbosity_colors) / sizeof(char *) - 1; } - if (colored) { + if (colored && isatty(STDERR_FILENO)) { fprintf(stderr, "%s", verbosity_colors[c]); } @@ -90,7 +90,7 @@ void sway_log_errno(log_importance_t verbosity, char* format, ...) { strerror_r(errno, error, sizeof(error)); fprintf(stderr, "%s", error); - if (colored) { + if (colored && isatty(STDERR_FILENO)) { fprintf(stderr, "\x1B[0m"); } fprintf(stderr, "\n"); |