mirror of https://github.com/thesofproject/sof.git
tools: logger: Skip double error logs to stdout
When out_fd points standard output then error message shouldn't be duplicated - duplicated messages only make logger output more messy. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This commit is contained in:
parent
11b9ca19cb
commit
354ff5ccf9
|
@ -68,7 +68,9 @@ static void log_err(FILE *out_fd, const char *fmt, ...)
|
|||
if (buff) {
|
||||
vsprintf(buff, fmt, args);
|
||||
fprintf(stderr, "%s", buff);
|
||||
if (out_fd) {
|
||||
|
||||
/* take care about out_fd validity and duplicated logging */
|
||||
if (out_fd && out_fd != stderr && out_fd != stdout) {
|
||||
fprintf(out_fd, "%s", buff);
|
||||
fflush(out_fd);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue