Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 1.84 KB

log.md

File metadata and controls

66 lines (45 loc) · 1.84 KB

Log

Translations: 简体中文

ZoomImage generates some logs during its run, which can help you find the problem when something goes wrong and help you understand it How ZoomImage works.

Logger

The Logger class encapsulates the print, level control, and output pipelines of logs

level

The Logger.level property controls the print level of the log, the default is INFO, you can modify it to expand the output range of the log

example:

val state: ZoomState by rememberZoomState()

LaunchEffect(Unit) {
    state.logger.level = Logger.DEBUG
}

SketchZoomAsyncImage(
    imageUri = "http://sample.com/sample.jpg",
    contentDescription = "view image",
    modifier = Modifier.fillMaxSize(),
    state = state,
)

pipeline

The Logger.pipeline property controls the output pipeline of the log, and the default is AndroidLogPipeline to output to Android console, you can modify it to output logs elsewhere

example:

val state: ZoomState by rememberZoomState()

state.logger.pipeline = MyLoggerPipeline()

SketchZoomAsyncImage(
    imageUri = "http://sample.com/sample.jpg",
    contentDescription = "view image",
    modifier = Modifier.fillMaxSize(),
    state = state,
)