Using EventQueue.invokeLater() to prevent wrong log formatting