如下是代码:
public static synchronized void d(String TAG, String content) {
Log.d(TAG, "robot : " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(new Date()) + content);
}
如下是traces部分日志。
"main" prio=5 tid=1 WaitingForDebuggerSend
| group="main" sCount=1 dsCount=0 obj=0x73a3f4a0 self=0xee285400
| sysTid=1375 nice=-10 cgrp=default sched=0/0 handle=0xf1036534
| state=S schedstat=( 1864681993184 49642950547 342220 ) utm=181892 stm=4575 core=5 HZ=100
| stack=0xff664000-0xff666000 stackSize=8MB
| held mutexes=
kernel: switch_to+0x98/0xa4
kernel: futex_wait_queue_me+0xd8/0x144
kernel: futex_wait+0xec/0x200
kernel: do_futex+0xdc/0x4ec
kernel: compat_SyS_futex+0xdc/0x168
kernel: el0_svc_naked+0x24/0x28
native: #00 pc 00017404 /system/lib/libc.so (syscall+28)
native: #01 pc 000b5a57 /system/lib/libart.so (_ZN3art5Mutex13ExclusiveLockEPNS_6ThreadE+210)
native: #02 pc 00247595 /system/lib/libart.so (_ZN3art4JDWP9JdwpState19SendBufferedRequestEjRKNSt316vectorI5iovecNS2_9allocatorIS4_EEEE+116)
native: #03 pc 002428bd /system/lib/libart.so (_ZN3art4JDWP9JdwpState13DdmSendChunkVEjPK5ioveci+620)
native: #04 pc 0010d52f /system/lib/libart.so (_ZN3art3Dbg15DdmSendHeapInfoENS0_8HpifWhenE+1262)
native: #05 pc 0010cb5b /system/lib/libart.so (_ZN3art3Dbg11GcDidFinishEv+462)
native: #06 pc 001936d5 /system/lib/libart.so (_ZN3art2gc4Heap22CollectGarbageInternalENS0_9collector6GcTypeENS0_7GcCauseEb+2548)
native: #07 pc 001968cf /system/lib/libart.so (_ZN3art2gc4Heap46PushOnThreadLocalAllocationStackWithInternalGCEPNS_6ThreadEPPNS_6mirror6ObjectE+46)
native: #08 pc 0039c2f1 /system/lib/libart.so (artAllocObjectFromCodeRosAlloc+352)
native: #09 pc 000adfd9 /system/lib/libart.so (art_quick_alloc_object_rosalloc+136)
native: #10 pc 002f0d03 /data/dalvik-cache/arm/system@framework@boot.oat (Java_android_icu_impl_ICUResourceBundleImpl_createBundleObject__Ljava_lang_String_2ILjava_util_HashMap_2Landroid_icu_util_UResourceBundle_2+334)
at android.icu.impl.ICUResourceBundleImpl.createBundleObject(ICUResourceBundleImpl.java:48)
at android.icu.impl.ICUResourceBundleImpl$ResourceTable.handleGet(ICUResourceBundleImpl.java:233)
at android.icu.util.UResourceBundle.findTopLevel(UResourceBundle.java:688)
at android.icu.impl.ICUResourceBundle.findTopLevel(ICUResourceBundle.java:419)
at android.icu.impl.ICUCurrencyDisplayInfoProvider$ICUCurrencyDisplayInfo.(ICUCurrencyDisplayInfoProvider.java:60)
at android.icu.impl.ICUCurrencyDisplayInfoProvider.getInstance(ICUCurrencyDisplayInfoProvider.java:41)
at android.icu.text.CurrencyDisplayNames.getInstance(CurrencyDisplayNames.java:36)
at android.icu.util.Currency.getName(Currency.java:521)
at android.icu.util.Currency.getSymbol(Currency.java:473)
at android.icu.util.Currency.getSymbol(Currency.java:463)
at java.util.Currency.getSymbol(Currency.java:213)
at java.text.DecimalFormatSymbols.setInternationalCurrencySymbol(DecimalFormatSymbols.java:396)
at java.text.DecimalFormatSymbols.fromIcuInstance(DecimalFormatSymbols.java:744)
at java.text.DecimalFormat.getDecimalFormatSymbols(DecimalFormat.java:831)
at java.text.SimpleDateFormat.zeroPaddingNumber(SimpleDateFormat.java:1334)
at java.text.SimpleDateFormat.subFormat(SimpleDateFormat.java:1110)
at java.text.SimpleDateFormat.format(SimpleDateFormat.java:959)
at java.text.SimpleDateFormat.format(SimpleDateFormat.java:929)
at java.text.DateFormat.format(DateFormat.java:337)
at com.flyingwings.cn.base.util.RobotDebugLog.d(RobotDebugLog.java:71)
- locked (a java.lang.Class) at com.flyingwings.cn.robot.service.robotinforservice.RobotStatusService$RobotStatusHandler.handleMessage(RobotStatusService.java:54) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6121) at java.lang.reflect.Method.invoke!(Native method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)