MarsConfig

internal object MarsConfig

Properties

Link copied to clipboard
lateinit var logCache: File

Cache directory. When logDir is not writable, it will be written to this directory. It is optional. If not selected, please provide "". If you want to provide it, it is recommended to provide the /data/data/packname/files/log directory of the application.

Link copied to clipboard
lateinit var logDir: File

Log directory. Please provide a separate directory for writing logs. Do not put other files except log files into this directory, otherwise they may be cleaned up by the automatic log cleaning function.

Link copied to clipboard

File writing modes are divided into asynchronous and synchronous. The Release version must use MarsWriteMode.Async. The Debug version can be both, but there may be lags when using MarsWriteMode.Sync.

Link copied to clipboard

File name prefix. For example, if the value is log, the generated file name is: log_20170102.xlog.

Link copied to clipboard

The pub_key used for encryption, please refer to the Xlog encryption guide for details.

Link copied to clipboard

The number of days to cache. Under normal circumstances, just fill in 0. Non-0 means that the log file will be stored in the logCache directory first, and the log will be moved from logCache to logDir after singleLogFileCacheDays days.

Link copied to clipboard

Whether to save log in one file every day.

Link copied to clipboard

The maximum size of a single log file. By default, the current day's logs are written to a file. By changing singleLogFileMaxSize you can Split the day's log into multiple files, each file size is singleLogFileMaxSize, singleLogFileMaxSize defaults to 1MB , means not to split the log into multiple files. It is recommended that each file should not exceed 10M.

Link copied to clipboard

The maximum storage time of a single log file. Minimum 1 day, default time 10 days.

Functions

Link copied to clipboard
fun close()
Link copied to clipboard
fun init()

Complete configuration.