Skip to content

Commit 36fe5ab

Browse files
committed
macos: see log output in xcode even with log-to-file on
1 parent 6d07a2a commit 36fe5ab

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

verbosity.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,13 @@ void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
321321
}
322322

323323
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
324-
if (fp)
324+
/* Emit to the terminal unconditionally so Terminal.app and
325+
* Xcode's console always see output. The file write is gated
326+
* on `initialized` (= a real log file was opened) because fp
327+
* defaults to stderr when no file is configured; without the
328+
* guard, every line would print twice in the no-file case. */
329+
printf("%s %s", tag_v, buffer);
330+
if (main_verbosity_st.initialized && fp)
325331
{
326332
fprintf(fp, "%s %s", tag_v, buffer);
327333
fflush(fp);
@@ -363,7 +369,7 @@ void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
363369
}
364370
#endif
365371

366-
if (fp)
372+
if (main_verbosity_st.initialized && fp)
367373
{
368374
fprintf(fp, "%s %s", tag_v, buffer);
369375
fflush(fp);

0 commit comments

Comments
 (0)