hermann icon indicating copy to clipboard operation
hermann copied to clipboard

Instead of fprintf, C extension should use a Ruby logger

Open rtyler opened this issue 10 years ago • 1 comments

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.

rtyler avatar Aug 30 '14 22:08 rtyler

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!"));

rtyler avatar Sep 02 '14 22:09 rtyler