(Throwable t)
| 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 |
no test coverage detected