-
Notifications
You must be signed in to change notification settings - Fork 0
Class JoggerDebug
Extends Jogger
Package jogger
File JoggerDebug.java
JoggerDebug is the class to manage the debug logs of an application.
This class is an extension of Jogger class.
For other methods check the class parent Jogger.
This is a simple construct.
Example:
JoggerDebug j = new JoggerDebug();
This construct set the log name.
Parameters:
- logName, name for log file
Example:
JoggerDebug j = new JoggerDebug("log_name");
This construct set the log name and the max size of log file.
Parameters:
- logName, name for log file
- maxSizeBytes, maximum size of log file, in bytes
Example:
JoggerDebug j = new JoggerDebug("log_name", 1024000);
This method check if the application is on debug mode.
Default false
Return:
Return true if the application is on debug mode, false otherwise.
Example:
JoggerDebug joggerDebug = new JoggerDebug(); if (joggerDebug.isDebug()) { // your code }
This method active or disable the debug mode.
Parameters:
- debug, true for active it, false otherwise
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true);
This method check if the print of stack trace on log is active.
Default true
Return:
Return true if the print of stack trace is active, false otherwise.
Example:
JoggerDebug joggerDebug = new JoggerDebug(); if (joggerDebug.isPrintStackTrace()) { // your code }
This method active or disable the print of stack trace on log.
Parameters:
- printStackTrace, true for active it, false otherwise
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.setPrintStackTrace(false);
Override
void writeLog(String write)
of Jogger
This method write, the string passed in input, on the debug log only if
the debug mode is enable.
If the printStackTrace mode is active, then it print the datetime with the
stacktrace and at end append your message. Otherwise if printStackTrace is
diasbled, then print only the datetime with your message.
Implement Jogger-Lock. For more info Jogger-Lock.
Parameters:
- write, string to be writer on debug log file
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeLog("DEBUG ENABLED");
This method write 'STARTING', through the writLog(String write)
method.
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeStart();
This method write 'STARTING' with your message, through the writLog(String write)
method.
Output format:
STARTING -- {0}
Parameters:
- write, message to be writer on debug log file
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeStart("JOGGER IS COOL!!!");
This method write 'END', through the writLog(String write)
method.
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeEnd();
This method write 'END' with your message, through the writLog(String write)
method.
Output format:
END -- {0}
Parameters:
- write, message to be writer on debug log file
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeEnd("420 TIME");
This method write 'SUCCESS', through the writLog(String write)
method.
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeSuccess();
This method write 'SUCCESS' with your message, through the writLog(String write)
method.
Output format:
SUCCESS -- {0}
Parameters:
- write, message to be writer on debug log file
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeSuccess("OH YES BABY!!!");
This method write 'FAIL', through the writLog(String write)
method.
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeFail();
This method write 'FAIL' with your message, through the writLog(String write)
method.
Output format:
FAIL -- {0}
Parameters:
- write, message to be writer on debug log file
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeFail("DAMN!!!");
This method write 'FAIL', through the writLog(String write)
method.
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeError();
This method write 'FAIL' with your message, through the writLog(String write)
method.
Output format:
FAIL -- {0}
Parameters:
- write, message to be writer on debug log file
Example:
JoggerDebug joggerDebug = new JoggerDebug(); joggerDebug.setDebug(true); joggerDebug.writeError("AZZ!!!");