only print stack when printStackTrace is set