Improve line error logging
Allow customization of expressions