Class Logs
java.util.logging.
Advantages of using a java.util.logging.Logger over using Logs:
1.) The minimum severity of a log statement for it to be logged can be adjusted without changing the code and recompiling, i.e. it can even be adjusted in the distribution version.
2.) The logging level can be adjusted on a per-package (and even per-class) basis, so e.g. developer #1 can get all logs for Collaboration but nothing else on stdout, while developer #2 gets his logs printed to a file and only sees Collaboration logs if they are severe.
Advantages of Logs overjava.util.logging.Logger:
1) You don't have to put private final Logger logger = Logger.getLogger(getClass().getName()) at the top of every class you want to put a log line in.
2) Logs will automatically be recorded and appear in the Geneious Crash System (Talkback)
- Since:
- API 4.202220 (Geneious 2022.2.0)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic longBest used in conjunction withstart().static voidLogs a message atLevel.FINEstatic voidLogs the String formatted withString.format(String, Object...)toLevel.FINELogs.static voidLogs a message to theLevel.INFOlog.static voidLogs the String formatted withString.format(String, Object...)toLevel.INFOLogs.static voidinfoButNotToStandardOut(String message) Logs a message to theLevel.INFOlog without attempting to print to standard out.static voidAdds a message to the history of the specified level.static voidLogs a message about something that should never happen under normal Geneious usage, and which has caused an irrecoverable crash.static voidLogs a message about something that should never happen under normal Geneious usage, and which has caused an irrecoverable crash.static longstart()Best used in conjunction withduration(long, long, String).static voidLogs a message about something that shouldn't happen under normal Geneious usage, but Geneious was able to recover without crashing (e.g.static voidLogs a message about something that shouldn't happen under normal Geneious usage, but Geneious was able to recover without crashing (e.g.
-
Field Details
-
SHARED
-
-
Method Details
-
fine
Logs the String formatted withString.format(String, Object...)toLevel.FINELogs. Note that logging to fine will not print the message to console by default.- Parameters:
format- The format stringarguments- The arguments referenced by the format specifiers in the format string.- Since:
- API 4.202220 (Geneious 2022.2.0)
- See Also:
-
fine
Logs a message atLevel.FINE- Parameters:
message- The message to log- Since:
- API 4.202220 (Geneious 2022.2.0)
-
info
Logs the String formatted withString.format(String, Object...)toLevel.INFOLogs.- Parameters:
format- The format stringarguments- The arguments referenced by the format specifiers in the format string.- Since:
- API 4.202220 (Geneious 2022.2.0)
- See Also:
-
info
Logs a message to theLevel.INFOlog. This should be used to log messages which may be helpful when debugging but are not necessary in production builds.- Parameters:
message- The message to log- Since:
- API 4.202220 (Geneious 2022.2.0)
-
infoButNotToStandardOut
Logs a message to theLevel.INFOlog without attempting to print to standard out. This should be used to log messages which may be helpful when debugging but are not necessary in production builds.- Parameters:
message- The message to log- Since:
- API 4.202220 (Geneious 2022.2.0)
-
warning
Logs a message about something that shouldn't happen under normal Geneious usage, but Geneious was able to recover without crashing (e.g. failure to load documents, failure to save a document, data that looks corrupt, user continuing to use Geneious with options they've been warned might cause Geneious to hang etc.). These messages will be printed during normal Command Line runs of Geneious.Logs the String formatted with
String.format(String, Object...)toLevel.WARNINGLogs. Note that logging to warning will print the message to standard out by default.- Parameters:
format- The format stringarguments- The arguments referenced by the format specifiers in the format string.- Since:
- API 4.202220 (Geneious 2022.2.0)
- See Also:
-
warning
Logs a message about something that shouldn't happen under normal Geneious usage, but Geneious was able to recover without crashing (e.g. failure to load documents, failure to save a document, data that looks corrupt, user continuing to use Geneious with options they've been warned might cause Geneious to hang etc.). These messages will be printed during normal Command Line runs of Geneious.- Parameters:
message- The message to log- Since:
- API 4.202220 (Geneious 2022.2.0)
-
severe
Logs a message about something that should never happen under normal Geneious usage, and which has caused an irrecoverable crash.Logs the String formatted with
String.format(String, Object...)toLevel.SEVERELogs. Note that logging to severe will print the message to standard out by default.- Parameters:
format- The format stringarguments- The arguments referenced by the format specifiers in the format string.- Since:
- API 4.202220 (Geneious 2022.2.0)
- See Also:
-
severe
Logs a message about something that should never happen under normal Geneious usage, and which has caused an irrecoverable crash.- Parameters:
message- The message to log- Since:
- API 4.202220 (Geneious 2022.2.0)
-
log
Adds a message to the history of the specified level. Messages will not be printed to standard out at any level.- Parameters:
message- The message to loglevel- The Log Level to log the message at- Since:
- API 4.202220 (Geneious 2022.2.0)
-
duration
Best used in conjunction withstart(). This method will log a message only if the time sincestart()was called is more thanlogIfDurationGreaterThanmilliseconds.For example:
long start = Logs.start(); // ...Do something... Logs.duration(start, 100, "Do Something took longer than 100ms");- Parameters:
start- time operation started is returned bystart()logIfDurationGreaterThan- in millisecondsmessage- a message to be displayed- Returns:
- the duration in milliseconds
- Since:
- API 4.202220 (Geneious 2022.2.0)
-
start
public static long start()Best used in conjunction withduration(long, long, String). This returns the current nano time, for use with thedurationmethod.For example:
long start = Logs.start(); // ...Do something... Logs.duration(start, 100, "Do Something took longer than 100ms");- Returns:
- The current nano time
- Since:
- API 4.202220 (Geneious 2022.2.0)
- See Also:
-