summaryrefslogtreecommitdiff
path: root/host-common
diff options
context:
space:
mode:
authorJason Macnak <natsu@google.com>2021-10-14 10:35:33 -0700
committerJason Macnak <natsu@google.com>2021-10-14 15:54:32 -0700
commite43e3a06b4a9c71e6f49648cfe44a8fd02176a10 (patch)
tree1582caeaf07730e2bd05032d4efd73973ceac7bd /host-common
parent2947cf310f44a68b6a266abb9b6a5fd44253a1bd (diff)
downloadvulkan-cereal-e43e3a06b4a9c71e6f49648cfe44a8fd02176a10.tar.gz
Start to consolidate logging into host-common/logging.h
... to make it easier to enable debug logging for Gfxstream Bug: b/189133053 Test: presubmit build Change-Id: I4f0e6bb32c68714085edc955890dd50cda072e58
Diffstat (limited to 'host-common')
-rw-r--r--host-common/logging.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/host-common/logging.h b/host-common/logging.h
index ed293ab6..c43a1460 100644
--- a/host-common/logging.h
+++ b/host-common/logging.h
@@ -1,3 +1,12 @@
#pragma once
+#include <cstdio>
+
+#define ENABLE_GL_LOG 1
+#if defined(ENABLE_GL_LOG)
+#define GL_LOG(fmt, args ...) fprintf(stderr, "%s:%d:%s: " fmt "\n", __FILE__, __LINE__, __func__, ## args)
+#else
#define GL_LOG(...)
+#endif
+
+#define ERR(fmt, args ...) fprintf(stderr, "%s:%d:%s: " fmt "\n", __FILE__, __LINE__, __func__, ## args) \ No newline at end of file