Comment 8 for bug 1350735

Revision history for this message
RaiMan (raimund-hocke) wrote :

-- the gem:
now only available on rubygems.org the version 1.1.0.2 should work.
https://rubygems.org/gems/sikulix

-- the logger redirect:
only to be clear:
$log must contain a logger instance, that contains as instance methods with the subsequently issued names.
the methods MUST have only one possible string parameter.

this was my functional test in Java, that worked.

public class APITest {

 @Test
 public void addingPrivateLogger() {
  Debug.test("addingPrivateLogger");
  Debug.info("this should be visible as info message");
  Debug.action("this should be visible as action log message");
  Debug.log("this should be visible as debug message");
  Debug.error("this should be visible as error message");
  boolean success = true;
  Debug.setLogger(new APITest());
  success &= Debug.setLoggerAll("info");
  Assert.assertTrue(success);
 }

 @Test
 public void usingPrivateLoggerInfo() {
  Debug.test("usingPrivateLogger");
  Debug.info("test message info");
  Debug.action("test message action log");
  Debug.error("test message error");
  Assert.assertTrue(true);
 }

 public void info(String msg) {
  System.out.println("[TEST] myLogger.info: " + msg);
 }
}

Might be, that you have to cast the given method name string to a java language string.

I think as a first step, you should make sure, that it works on the java level in your environment and then step up to JRuby.