public function traceLog(string $key = null, $message = null)
    {
        if ($this->trace_log_enabled) {
            if (is_array($message) || is_object($message)) {
                $text = print_r($message, true);
            } elseif ($message === null) {
                $text = "[null]";
            } elseif ($message === false) {
                $text = "[false]";
            } elseif ($message === true) {
                $text = "[true]";
            } else {
                $text = $message;
            }
            error_log("=== " . ($key !== null ? "$key: " : '') . $text);
        }

        if ($key === null) {
            if ($this->trace_log_buffer === null) {
                $this->trace_log_buffer = array();
            }
            if (array_key_exists(self::MESSAGES_STACK, $this->trace_log_buffer)) {
                $this->trace_log_buffer[self::MESSAGES_STACK][] = $message;
            } else {
                $this->trace_log_buffer[self::MESSAGES_STACK] = array($message);
            }
        } else {
            $this->trace_log_buffer[$key] = $message;
        }
    }
public function traceLog(string $key = null, $message = null)
    {
        if ($this->trace_log_enabled) {
            if (is_array($message) || is_object($message)) {
                $text = print_r($message, true);
            } elseif ($message === null) {
                $text = "[null]";
            } elseif ($message === false) {
                $text = "[false]";
            } elseif ($message === true) {
                $text = "[true]";
            } else {
                $text = $message;
            }
            error_log("=== " . ($key !== null ? "$key: " : '') . $text);
        }

        if ($key === null) {
            if ($this->trace_log_buffer === null) {
                $this->trace_log_buffer = array();
            }
            if (array_key_exists(self::MESSAGES_STACK, $this->trace_log_buffer)) {
                $this->trace_log_buffer[self::MESSAGES_STACK][] = $message;
            } else {
                $this->trace_log_buffer[self::MESSAGES_STACK] = array($message);
            }
        } else {
            $this->trace_log_buffer[$key] = $message;
        }
    }
public function traceLog ( string $ key = null , $ message = null ) { if ( $ this -> trace_log_enabled ) { if ( is_array ( $ message ) || is_object ( $ message ) ) { $ text = print_r ( $ message , true ) ; } elseif ( $ message === null ) { $ text = "[null]" ; } elseif ( $ message === false ) { $ text = "[false]" ; } elseif ( $ message === true ) { $ text = "[true]" ; } else { $ text = $ message ; } error_log ( "=== " . ( $ key !== null ? "$key: " : '' ) . $ text ) ; } if ( $ key === null ) { if ( $ this -> trace_log_buffer === null ) { $ this -> trace_log_buffer = array ( ) ; } if ( array_key_exists ( self :: MESSAGES_STACK , $ this -> trace_log_buffer ) ) { $ this -> trace_log_buffer [ self :: MESSAGES_STACK ] [ ] = $ message ; } else { $ this -> trace_log_buffer [ self :: MESSAGES_STACK ] = array ( $ message ) ; } } else { $ this -> trace_log_buffer [ $ key ] = $ message ; } }
Traces a categorized data in the error log default system and stores it inside
the instance to be transmited after to a logs analyzer database.
@param string|null $key Categorized data key identifier
@param mixed|null $message Text message to log
Traces a categorized data in the error log default system and stores it inside the instance to be transmited after to a logs analyzer database .