public class LogEntry extends Object
LogEntry.
It contains the message that should be logged,
in which color it should be printed,
the logging-level it has,
an error code if required,
an exception if required
and weather it should be saved in a file or only printed.
It can also be set to be only visible if the Logger is in verbose- or debug-mode.| Constructor and Description |
|---|
LogEntry(String text)
Create a new
LogEntry with the given text. |
LogEntry(String text,
String templateName)
Create a new
LogEntry with the provided text,
based on the given LogTemplate-name. |
| Modifier and Type | Method and Description |
|---|---|
LogEntry |
CODE(int exceptionCode)
Set a specific error code for the
LogEntry to use. |
LogEntry |
COLOR(String colorCode)
Change the color that should be used when the
LogEntry is printed. |
LogEntry |
DEBUG(boolean onlyInDebugMode)
Set the debug-state of this
LogEntry. |
LogEntry |
EXCEPTION(Exception e)
|
LogEntry |
FILE_ENTRY(boolean shouldWriteToFile)
Set weather the
LogEntry should be stored in the log-file or not. |
LogEntry |
LEVEL(String levelEnum)
Change the logging-level that should be used for this
LogEntry. |
LogEntry |
MIXPANEL(boolean sendToMixpanel)
Require this
LogEntry to send its information to Mixpanel. |
LogEntry |
MIXPANELNAME(String mixpanelEvent)
Change the Mixpanel event name for this
LogEntry. |
LogEntry |
PLAINTEXT(boolean onlyPlaintext)
Stop this
LogEntry from using the prefix information. |
LogEntry |
VERBOSE(boolean onlyInVerboseMode)
Set the verbose-state of this
LogEntry. |
public LogEntry(String text)
LogEntry with the given text.text - The message that should be logged.public LogEntry(String text, String templateName) throws IllegalArgumentException
LogEntry with the provided text,
based on the given LogTemplate-name.text - The message that should be logged.templateName - The name of the LogTemplate that should be used for the logging-behaviour.IllegalArgumentException - Will throw if a LogTemplate with the provided name does not exist.public LogEntry COLOR(String colorCode)
LogEntry is printed.colorCode - The new color code
(Default will use the current console-color).LogEntry to be used further.public LogEntry LEVEL(String levelEnum)
LogEntry.levelEnum - The new logging-level
(Default is INFO).LogEntry to be used further.public LogEntry CODE(int exceptionCode)
LogEntry to use.exceptionCode - The code that should be printed and saved
(Default will not use an error-code).LogEntry to be used further.public LogEntry FILE_ENTRY(boolean shouldWriteToFile)
LogEntry should be stored in the log-file or not.public LogEntry PLAINTEXT(boolean onlyPlaintext)
LogEntry from using the prefix information.
The removed prefix information is the time, logging-level and error-code.public LogEntry MIXPANEL(boolean sendToMixpanel)
LogEntry to send its information to Mixpanel.
This requires you to set up the MixpanelHandler correctly.public LogEntry MIXPANELNAME(String mixpanelEvent)
LogEntry.
Using Mixpanel Logs requires you to set up the MixpanelHandler correctly.Copyright © 2022. All rights reserved.