debug log support - optimize