I have written a custom MyLogger library based on Observer design pattern. What I am trying to achieve is this: Every time I call writeLog(LOG_LEVEL,"Text")
method I want it to execute in a new thread. Can someone please suggest what will be the way to achieve this. As in where shall I create threads.
This is how my Logger call looks.
public class Logger extends Subject{
void writeLog(String type, String message)
{ setData(message);
notifyy(type);
}
}
And this is how I am calling writeLog
appLogger.writeLog("ERROR", "This is error");