Skip to content

Debug message to console #39

Closed
Closed
@seanshpark

Description

@seanshpark

Need debug message logging like in JerryScript

+#ifdef JERRY_ENABLE_LOG
+#define JERRY_LOG(lvl, ...) \
+  do \
+  { \
+    if (lvl <= jerry_debug_level && jerry_log_file) \
+    { \
+      fprintf (jerry_log_file, __VA_ARGS__); \
+    } \
+  } \
+  while (0)
+
+#define JERRY_DLOG(...) JERRY_LOG (1, __VA_ARGS__)
+#define JERRY_DDLOG(...) JERRY_LOG (2, __VA_ARGS__)
+#define JERRY_DDDLOG(...) JERRY_LOG (3, __VA_ARGS__)
+#else /* !JERRY_ENABLE_LOG */
+#define JERRY_DLOG(...) \
+  do \
+  { \
+    if (false) \
+    { \
+      jerry_ref_unused_variables (0, __VA_ARGS__); \
+    } \
+  } while (0)
+#define JERRY_DDLOG(...) JERRY_DLOG (__VA_ARGS__)
+#define JERRY_DDDLOG(...) JERRY_DLOG (__VA_ARGS__)
+#endif /* !JERRY_ENABLE_LOG */

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions