public abstract class AbstractFormatter extends Object implements LogFormatter
| Modifier and Type | Field and Description |
|---|---|
static int |
ANSI_FG_BLUE |
static int |
ANSI_FG_GREEN |
static int |
ANSI_FG_MAGENTA |
static int |
ANSI_FG_RED |
static int |
ANSI_FG_YELLOW |
| Constructor and Description |
|---|
AbstractFormatter() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getDayMillis(long millis,
ZoneId zoneId)
Convert a time in epoch millis to millis from start of day (local time).
|
static void |
outputANSIColour(int code,
IntConsumer outFunction)
Output an ANSI colour sequence.
|
static void |
outputLevel(net.pwall.log.Level level,
IntConsumer outFunction)
Output the level.
|
static void |
outputLevel5(net.pwall.log.Level level,
IntConsumer outFunction)
Output the level as 5 characters, using pre-configured colours and space padding where necessary.
|
static void |
outputLevel5Coloured(net.pwall.log.Level level,
IntConsumer outFunction)
Output the level as 5 characters, using pre-configured colours and space padding where necessary.
|
static void |
outputLevelColoured(net.pwall.log.Level level,
IntConsumer outFunction)
Output the level, using pre-configured colours.
|
static void |
outputNameWithLimit(int limit,
String name,
IntConsumer outFunction)
Output the logger name, with a limit on the width.
|
static void |
outputText(CharSequence text,
IntConsumer outFunction)
Output text.
|
static void |
outputTime(int dayMillis,
IntConsumer outFunction)
Output the time in the form hh:mm:ss.nnn, given a time as millisecond offset within a day.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitformatpublic static final int ANSI_FG_MAGENTA
public static final int ANSI_FG_BLUE
public static final int ANSI_FG_GREEN
public static final int ANSI_FG_YELLOW
public static final int ANSI_FG_RED
public static void outputTime(int dayMillis,
IntConsumer outFunction)
java.time classes.dayMillis - the time as milliseconds in dayoutFunction - the IntConsumer to use to output the valuepublic static void outputLevel(net.pwall.log.Level level,
IntConsumer outFunction)
level - the LeveloutFunction - the IntConsumer to use to output the valuepublic static void outputLevelColoured(net.pwall.log.Level level,
IntConsumer outFunction)
level - the LeveloutFunction - the IntConsumer to use to output the valuepublic static void outputLevel5(net.pwall.log.Level level,
IntConsumer outFunction)
level - the LeveloutFunction - the IntConsumer to use to output the valuepublic static void outputLevel5Coloured(net.pwall.log.Level level,
IntConsumer outFunction)
level - the LeveloutFunction - the IntConsumer to use to output the valuepublic static void outputText(CharSequence text, IntConsumer outFunction)
text - the text (as a CharSequence)outFunction - the IntConsumer to use to output the textpublic static void outputNameWithLimit(int limit,
String name,
IntConsumer outFunction)
limit - the maximum number of charactersname - the nameoutFunction - the IntConsumer to use to output the namepublic static void outputANSIColour(int code,
IntConsumer outFunction)
code - the code in the ANSI sequenceoutFunction - the IntConsumer to use to output the sequenceCopyright © 2024. All rights reserved.