Package ai.platon.pulsar.common
Class MessageWriter
-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public final class MessageWriter implements AutoCloseable
A simple log system
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMessageWriter.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static IntegerOFFpublic final static IntegerERRORpublic final static IntegerWARNpublic final static IntegerINFOpublic final static IntegerDEBUGprivate final Longidprivate final InstantlastActiveTimeprivate final DurationidleTimeprivate DurationidleTimeoutprivate final BooleanisIdleprivate IntegermaxFileSizeprivate SimpleDateFormatdateFormatprivate IntegercheckSizeprivate BooleanwritingErrorprivate IntegercloseCountprivate final PathfilePathprivate IntegerlevelFilepublic final static MessageWriter.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description MessageWriter(Path filePath, Integer levelFile)
-
Method Summary
Modifier and Type Method Description final LonggetId()final InstantgetLastActiveTime()final DurationgetIdleTime()final DurationgetIdleTimeout()final UnitsetIdleTimeout(Duration idleTimeout)final BooleanisIdle()final IntegergetMaxFileSize()final UnitsetMaxFileSize(Integer maxFileSize)final SimpleDateFormatgetDateFormat()final UnitsetDateFormat(SimpleDateFormat dateFormat)final IntegergetCheckSize()final UnitsetCheckSize(Integer checkSize)final BooleangetWritingError()final UnitsetWritingError(Boolean writingError)final IntegergetCloseCount()final UnitsetCloseCount(Integer closeCount)final PathgetFilePath()final IntegergetLevelFile()final UnitsetLevelFile(Integer levelFile)final Unitwrite(String s)final Unitwrite(Integer level, KClass<?> clazz, String s, Throwable t)final Unitwrite(Integer level, String module, String s, Throwable t)final Unitflush()Unitclose()-
-
Method Detail
-
getLastActiveTime
final Instant getLastActiveTime()
-
getIdleTime
final Duration getIdleTime()
-
getIdleTimeout
final Duration getIdleTimeout()
-
setIdleTimeout
final Unit setIdleTimeout(Duration idleTimeout)
-
getMaxFileSize
final Integer getMaxFileSize()
-
setMaxFileSize
final Unit setMaxFileSize(Integer maxFileSize)
-
getDateFormat
final SimpleDateFormat getDateFormat()
-
setDateFormat
final Unit setDateFormat(SimpleDateFormat dateFormat)
-
getCheckSize
final Integer getCheckSize()
-
setCheckSize
final Unit setCheckSize(Integer checkSize)
-
getWritingError
final Boolean getWritingError()
-
setWritingError
final Unit setWritingError(Boolean writingError)
-
getCloseCount
final Integer getCloseCount()
-
setCloseCount
final Unit setCloseCount(Integer closeCount)
-
getFilePath
final Path getFilePath()
-
getLevelFile
final Integer getLevelFile()
-
setLevelFile
final Unit setLevelFile(Integer levelFile)
-
-
-
-