hermann
hermann copied to clipboard
Instead of fprintf, C extension should use a Ruby logger
Right now hermann_lib.c
has a number of calls to fprintf
to record information/logging info to stderr
. It really should send that information to a Ruby logger.
I think this should be fairly straightforward to accomplish if the constructor receives Ruby logger object
VALUE logger;
/* get the :debug symbol for dispatch */
ID debug_sym = rb_intern("debug");
/* dispatch to logger#debug with "LOGGING!" as the String */
VALUE result = rb_funcall(logger, debug_sym, 1, rb_str_new2("LOGGING!"));