如何更改日志记录级别

时间:2019-05-11 13:34:21

标签: flutter

当我使用flutter run命令启动新创建的flutter应用程序时,开始出现很多混乱的冗长日志

我不知道是否正在发生这种情况,因为我遇到了一些问题,或者仅仅是日志记录的级别已设置为较低的级别

这只是一个样本

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
F/m.android.phon(22843): java_vm_ext.cc:542] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0xe
F/m.android.phon(22843): java_vm_ext.cc:542]     string: 'H�'
F/m.android.phon(22843): java_vm_ext.cc:542]     input: '0x48 0xc5 <0x0e>'
F/m.android.phon(22843): java_vm_ext.cc:542]     in call to NewStringUTF
F/m.android.phon(22843): java_vm_ext.cc:542]     from java.lang.String android.os.HwBlob.getString(long)
F/m.android.phon(22843): java_vm_ext.cc:542] "HwBinder:22843_1" prio=5 tid=14 Runnable
F/m.android.phon(22843): java_vm_ext.cc:542]   | group="main" sCount=0 dsCount=0 flags=0 obj=0x13801610 self=0xe6148000
F/m.android.phon(22843): java_vm_ext.cc:542]   | sysTid=22863 nice=0 cgrp=default sched=0/0 handle=0xd0da5970
F/m.android.phon(22843): java_vm_ext.cc:542]   | state=R schedstat=( 13371500 5442500 189 ) utm=1 stm=0 core=1 HZ=100
F/m.android.phon(22843): java_vm_ext.cc:542]   | stack=0xd0caa000-0xd0cac000 stackSize=1010KB
F/m.android.phon(22843): java_vm_ext.cc:542]   | held mutexes= "mutator lock"(shared held)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #00 pc 004152f6  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+198)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #01 pc 0051048e  /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+382)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #02 pc 0050b743  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+83)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #03 pc 0031a8b0  /system/lib/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1088)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #04 pc 0031ad21  /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, char*)+113)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #05 pc 000d60f7  /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::AbortF(char const*, ...)+71)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #06 pc 000d5fa1  /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::CheckNonHeapValue(char, art::(anonymous namespace)::JniValueType)+1089)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #07 pc 000d4617  /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::CheckPossibleHeapValue(art::ScopedObjectAccess&, char, art::(anonymous namespace)::JniValueType)+135)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #08 pc 000d3bdb  /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::(anonymous namespace)::JniValueType*)+811)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #09 pc 000c8856  /system/lib/libart.so (art::(anonymous namespace)::CheckJNI::NewStringUTF(_JNIEnv*, char const*)+902)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #10 pc 000da41c  /system/lib/libandroid_runtime.so (JHwBlob_native_getString(_JNIEnv*, _jobject*, long long)+156)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #11 pc 003da240  /system/framework/x86/boot-framework.oat (offset 3ca000) (android.hardware.usb.UsbDeviceConnection.native_request_wait [DEDUPED]+128)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #12 pc 007f966b  /system/framework/x86/boot-framework.oat (offset 3ca000) (android.hardware.radio.V1_0.SetupDataCallResult.readEmbeddedFromParcel+187)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #13 pc 007f9a9c  /system/framework/x86/boot-framework.oat (offset 3ca000) (android.hardware.radio.V1_0.SetupDataCallResult.readFromParcel [DEDUPED]+92)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #14 pc 001dd51b  /system/framework/x86/boot-telephony-common.oat (offset 86000) (android.hardware.radio.V1_2.IRadioResponse$Stub.onTransact+19739)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #15 pc 005f0b82  /system/lib/libart.so (art_quick_invoke_stub+338)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #16 pc 000a30ce  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+222)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #17 pc 004d3349  /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+89)
F/m.android.phon(22843): java_vm_ext.cc:542]   native: #18 pc 004d4937  /system/lib/libart.so (art::InvokeVirtualOrInterfaceWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, char*)+471)

日志太长,我将其上传到这里https://gist.github.com/naif-alsaleh/ee29caec5e63f732b36e3980add39bac,这只是不到5秒的日志

我可以更改日志级别吗?

1 个答案:

答案 0 :(得分:0)

您正在调试模式下运行,并且在此模式下消息是正常的。您可以尝试使用--release标志执行以避免,但是不建议这样做。