Skip to main content

Error Logger


Object trait is located in Eightshift Libs. To extend it, use Eightshift_Libs\Helpers\Error_Logger class.

If you are working with Ajax or REST API in your project, this logger will come in handy. We have created this simple trait helper that you can use in any PHP class as a trait.


Ensure correct response for rest using the handler function.

  • @param integer $code Response Status code.

  • @param string $status Response Status name. (success/error).

  • @param string|null $msg Response Message.

  • @param array|null $data Response additional data.

  • @return \WP_Error|array \WP_Error instance with error message and status or array.