Graphviz 13.0.0~dev.20250210.0415
Loading...
Searching...
No Matches
debug.h File Reference

helpers for verbose/debug printing More...

#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <util/lockfile.h>
Include dependency graph for debug.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GV_INFO(...)
 
#define GV_DEBUG(...)   GV_INFO(__VA_ARGS__)
 

Macro Definition Documentation

◆ GV_DEBUG

#define GV_DEBUG (   ...)    GV_INFO(__VA_ARGS__)

print a debug message

The distinction between this and GV_INFO is purely semantic; this is intended for messages for Graphviz developers while GV_INFO is intended for messages for Graphviz users. In future, GV_DEBUG may use something other than Verbose to guard its output.

Definition at line 39 of file debug.h.

◆ GV_INFO

#define GV_INFO (   ...)
Value:
do { \
if (Verbose) { \
const char *const name_ = strrchr(__FILE__, '/') == NULL \
? __FILE__ \
: strrchr(__FILE__, '/') + 1; \
lockfile(stderr); \
const time_t now_ = time(NULL); \
const struct tm *const now_tm_ = localtime(&now_); \
fprintf(stderr, "[Graphviz] %s:%d: %04d-%02d-%02d %02d:%02d: ", name_, \
__LINE__, now_tm_->tm_year + 1900, now_tm_->tm_mon + 1, \
now_tm_->tm_mday, now_tm_->tm_hour, now_tm_->tm_sec); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
unlockfile(stderr); \
} \
} while (0)
static bool Verbose
Definition gml2gv.c:23
node NULL
Definition grammar.y:163

print an informational message

This assumes the Verbose global is in scope.

Definition at line 15 of file debug.h.