Add optional logging for tab completion