Skip to content

Commit

Permalink
Add OBS_VKCAPTURE_QUIET=1 to disable layer logging
Browse files Browse the repository at this point in the history
Closes #193
  • Loading branch information
nowrep committed Feb 5, 2024
1 parent 9f8ad3f commit 2c1a563
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ Paste OBS log here.
**Game log:**
```
Paste game terminal output here.
Make sure to set OBS_VKCAPTURE_QUIET=0 environment variable.
```
13 changes: 12 additions & 1 deletion src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>

static inline int os_dupfd_cloexec(int fd)
Expand All @@ -44,4 +45,14 @@ static inline int64_t os_time_get_nano(void)
return tv.tv_nsec + tv.tv_sec * INT64_C(1000000000);
}

#define hlog(msg, ...) fprintf(stderr, "[obs-vkcapture] " msg "\n", ##__VA_ARGS__)
static bool hlog_quiet(void)
{
static int quiet = -1;
if (quiet == -1) {
const char *q = getenv("OBS_VKCAPTURE_QUIET");
quiet = q && atoi(q) == 1;
}
return quiet;
}

#define hlog(msg, ...) if (!hlog_quiet()) fprintf(stderr, "[obs-vkcapture] " msg "\n", ##__VA_ARGS__)

0 comments on commit 2c1a563

Please sign in to comment.