MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / logThrowable

Method logThrowable

CodenameOne/src/com/codename1/io/Log.java:412–432  ·  view source on GitHub ↗
(Throwable t)

Source from the content-addressed store, hash-verified

410 ///
411 /// - `t`
412 protected void logThrowable(Throwable t) {
413 if (t == null) {
414 p("Exception logging invoked with null exception...");
415 return;
416 }
417 print("Exception: " + t.getClass().getName() + " - " + t.getMessage(), ERROR);
418 Thread thr = Thread.currentThread();
419 if (thr instanceof CodenameOneThread && ((CodenameOneThread) thr).hasStackFrame()) {
420 print(((CodenameOneThread) thr).getStack(t), ERROR);
421 }
422 t.printStackTrace();
423 try {
424 synchronized (this) {
425 Writer w = getWriter(); //NOPMD CloseResource - shared writer managed by Log
426 Util.getImplementation().printStackTraceToStream(t, w);
427 w.flush();
428 }
429 } catch (IOException err) {
430 err.printStackTrace();
431 }
432 }
433
434 /// Default log implementation prints to the console and the file connector
435 /// if applicable. Also prepends the thread information and time before

Callers 1

eMethod · 0.45

Calls 13

pMethod · 0.95
printMethod · 0.95
currentThreadMethod · 0.95
getWriterMethod · 0.95
getImplementationMethod · 0.95
flushMethod · 0.95
getNameMethod · 0.65
getMessageMethod · 0.65
getClassMethod · 0.45
hasStackFrameMethod · 0.45
getStackMethod · 0.45
printStackTraceMethod · 0.45

Tested by

no test coverage detected