key = wp_generate_password( 5, false ); $this->starttime = microtime( true ); if ( ! is_null( $message ) ) { $this->report( $message ); } return; } /** * Writes a string to the debug log, including the logger's ID string. * * @access public * @since 4.8.0 * * @param string $message The string to be written to the log. */ public function report( $message ) { if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { error_log( 'jp-sitemap-' . $this->key . ': ' . $message ); } return; } /** * Writes the elapsed lifetime of the logger to the debug log, with an optional message. * * @access public * @since 4.8.0 * * @param string $message The optional message string. Default is the empty string. */ public function time( $message = '' ) { $time = round( microtime( true ) - $this->starttime, 3 ); $this->report( $message . ' ' . $time . ' seconds elapsed.' ); return; } }