panpf / sketch

Sketch is an image loading library designed for Compose Multiplatform and Android View. It is powerful and rich in functions. In addition to basic functions, it also supports GIF, SVG, video thumbnails, Exif Orientation, etc.
Apache License 2.0
2k stars 307 forks source link

日志没办法过滤的么,UriInvalidException: Request uri is empty or blank老是打印这个 #180

Closed vickyleu closed 1 year ago

vickyleu commented 1 year ago

Sketch: main - RequestExecutor. Request failed. Request uri is empty or blank. '' com.github.panpf.sketch.request.UriInvalidException: Request uri is empty or blank

这个日志我想关掉打印,现在是直接抛出了一个异常, 自定义了一个SketchLogProxy

override fun e(tag: String, msg: String, tr: Throwable?) {
            if(tr is UriInvalidException)return
            Log.e(tag, msg, tr)
        }

还是很多没意义的打印日志,几百行日志输出,其实简短一行打印就够了,这并不是很严重的问题,虽然程序运行不受影响,但是看着挺难受😭,比如新用户就没有头像的

panpf commented 1 year ago

uri 空就是个错误,必须得打印出来。针对用户头像的场景,你可以在调用的时候判断一下是空的话就传入默认头像的 uri

vickyleu commented 1 year ago

发现新版本中有空uri的参数啦

uriEmpty:Painter?

大佬牛逼