File tree Expand file tree Collapse file tree
FlowHttp/src/main/java/com/bhm/network/core
app/src/main/java/com/bhm/sdk/demo/activity Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,7 +261,9 @@ class HttpOptions(private val builder: Builder) {
261261 }
262262
263263 fun build (): HttpOptions {
264- return HttpOptions (this )
264+ val options = HttpOptions (this )
265+ JobManager .get().setHttpOptions(options)
266+ return options
265267 }
266268 }
267269
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class LoggingInterceptor {
1717
1818 fun make (builder : HttpOptions ): HttpLoggingInterceptor {
1919 return HttpLoggingInterceptor { message: String ->
20- if ( builder.isLogOutPut) {
20+ builder.httpLogEvent?. let {
2121 // 请求或者响应开始
2222 if (message.startsWith(" --> POST" ) || message.startsWith(" --> GET" )) {
2323 mMessage.delete(0 , mMessage.length)
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ import com.bhm.netcore.R
1616import com.bhm.network.base.HttpLoadingDialog
1717import com.bhm.network.core.HttpOptions
1818import com.bhm.network.core.RequestManager
19+ import com.bhm.network.core.callback.HttpLogEvent
20+ import com.bhm.network.define.HttpLogLevel
1921import com.bhm.network.define.ResultException
2022import com.bhm.sdk.demo.adapter.MainUIAdapter
2123import com.bhm.sdk.demo.entity.DoGetEntity
@@ -159,6 +161,13 @@ open class MainActivity : FragmentActivity() {
159161 .buildRequest<DoGetEntity >()
160162 .setHttpOptions(HttpOptions .create(this )
161163 .setLoadingDialog(HttpLoadingDialog ())
164+ .setIsLogOutPut(false )
165+ .setHttpLogEvent(object : HttpLogEvent {
166+ override fun onLog (level : HttpLogLevel , tag : String , message : String? ) {
167+ Log .e(tag, (" 自定义输出日志:$message " ))
168+ }
169+
170+ })
162171 .setDialogAttribute(
163172 isShowDialog = true ,
164173 cancelable = true ,
You can’t perform that action at this time.
0 commit comments