object GangLogger
GangLogger is a logger stack tool to store multiple loggers, and iteratively perform the log write action.
GangLogger object can statically execute setLoggerAndConfiguration, killLogger, getLogger, clearLogger2Configuration and etc.
like:
import cn.tellyouwhat.gangsutils.logger.GangLogger
import cn.tellyouwhat.gangsutils.logger.SupportedLogDest.{LOCAL_HTML_LOGGER, PRINTLN_LOGGER}
import cn.tellyouwhat.gangsutils.logger.cc.LoggerConfiguration
import cn.tellyouwhat.gangsutils.logger.dest.fs.LocalHtmlLogger
LocalHtmlLogger.setLogSavePath("logs/ground.html")
GangLogger.setLoggerAndConfiguration(Map(
PRINTLN_LOGGER -> LoggerConfiguration(isDTEnabled = true, isTraceEnabled = true, isHostnameEnabled = true, logPrefix = Some("prefix")),
LOCAL_HTML_LOGGER -> LoggerConfiguration(isDTEnabled = true, isTraceEnabled = true, isHostnameEnabled = true, logPrefix = Some("prefix")),
))
val logger: GangLogger = GangLogger()
- Alphabetic
- By Inheritance
- GangLogger
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(): GangLogger
if you have not execute
setLoggerAndConfiguration, a map of PRINTLN_LOGGER -> LoggerConfiguration will be created with the default values.if you have not execute
setLoggerAndConfiguration, a map of PRINTLN_LOGGER -> LoggerConfiguration will be created with the default values.if you have executed
setLoggerAndConfiguration, the specified loggers will be create.- returns
the expected GangLogger instance
-
def
apply(isDTEnabled: Boolean = true, isTraceEnabled: Boolean = false, isHostnameEnabled: Boolean = true, logPrefix: Option[String] = None, logLevel: LogLevel.Value = LogLevel.TRACE): GangLogger
if you fill these parameters without executing
setLoggerAndConfiguration, a map of PRINTLN_LOGGER -> LoggerConfiguration will be created with the parameters you filled.if you fill these parameters without executing
setLoggerAndConfiguration, a map of PRINTLN_LOGGER -> LoggerConfiguration will be created with the parameters you filled.if you fill these parameters with
setLoggerAndConfigurationexecuted, the specified loggers will be create.- isDTEnabled
is datetime enabled, if
setLoggerAndConfigurationhas already been executed, this parameter will be ignored- isTraceEnabled
is trace enabled, if
setLoggerAndConfigurationhas already been executed, this parameter will be ignored- isHostnameEnabled
is hostname enabled, if
setLoggerAndConfigurationhas already been executed, this parameter will be ignored- logPrefix
option of log prefix string, if
setLoggerAndConfigurationhas already been executed, this parameter will be ignored- logLevel
one of
LogLevellog level, ifsetLoggerAndConfigurationhas already been executed, this parameter will be ignored- returns
the expected GangLogger instance
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clearLogger2Configuration(): Unit
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
getLogger: GangLogger
get GangLogger instance if the underlying _logger is not None or apply a new one if it is
get GangLogger instance if the underlying _logger is not None or apply a new one if it is
- returns
the GangLogger instance
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
killLogger(): Unit
清除单例 GangLogger 对象
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
setLoggerAndConfiguration(m: Map[SupportedLogDest.Value, LoggerConfiguration]): Unit
set the log destination to LoggerConfiguration mappings
set the log destination to LoggerConfiguration mappings
- m
the log destination to LoggerConfiguration mappings
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated