you have some logger instance (e.g. myLogger), which in turn has some methods like .info, .error, .warning, ...., that accept a string as the one and only parameter.
now you can tell Debug to redirect to your logger using one of these methods:
according to the message groups Settings.ActionLogs ( [log] ), Settings.InfoLogs( [info] ), Settings.DebugLogs ( [debug] )
additionally we have the error group ( [error] )
From now on messages created using Debug.info() would be redirected to myLogger.info(original_message) using reflection (the reason for the string parameter, to avoid the Java interface/callback implementation overhead).
question: should the prefix [.....] be contained in the message or would this be more flexible:
Debug.setLogger(myLogger)
Debug.setLoggerInfo("info", "new prefix");
Debug.setLoggerAction("whatever", "new prefix");
Debug.setLoggerError( "whatever", "new prefix");
Debug.setLoggerDebug("whatever", "new prefix");
additionally this could be convenient:
Debug.setLoggerAll(myLogger, "whatever", "new prefix");
which would return a message
[new prefix log/info/debug/error] message
this is my idea about how to implement this:
you have some logger instance (e.g. myLogger), which in turn has some methods like .info, .error, .warning, ...., that accept a string as the one and only parameter.
now you can tell Debug to redirect to your logger using one of these methods:
Debug.setLogger Info(myLogger, "info"); Action( myLogger, "whatever"); Error(myLogger, "whatever"); Debug(myLogger, "whatever");
Debug.setLogger
Debug.setLogger
Debug.setLogger
according to the message groups Settings.ActionLogs ( [log] ), Settings.InfoLogs( [info] ), Settings.DebugLogs ( [debug] )
additionally we have the error group ( [error] )
From now on messages created using Debug.info() would be redirected to myLogger. info(original_ message) using reflection (the reason for the string parameter, to avoid the Java interface/callback implementation overhead).
question: should the prefix [.....] be contained in the message or would this be more flexible: (myLogger) Info("info" , "new prefix"); Action( "whatever" , "new prefix"); Error( "whatever", "new prefix"); Debug(" whatever" , "new prefix");
Debug.setLogger
Debug.setLogger
Debug.setLogger
Debug.setLogger
Debug.setLogger
additionally this could be convenient: All(myLogger, "whatever", "new prefix");
Debug.setLogger
which would return a message debug/error] message
[new prefix log/info/