How to post error log in Error Log doctype?

Is there some function in frappe to create error log like these ?

frappe.log_error(frappe.get_traceback())

1 Like