application/Espo/Core/Utils/Json.php
public static function encode($value, $options = 0)
    {
        $json = json_encode($value, $options);

        $error = self::getLastError();
        if ($json === null || !empty($error)) {
            $GLOBALS['log']->error('Json::encode():' . $error . ' - ' . print_r($value, true));
        }

        return $json;
    }
public static function encode($value, $options = 0)
    {
        $json = json_encode($value, $options);

        $error = self::getLastError();
        if ($json === null || !empty($error)) {
            $GLOBALS['log']->error('Json::encode():' . $error . ' - ' . print_r($value, true));
        }

        return $json;
    }
public static function encode ( $ value , $ options = 0 ) { $ json = json_encode ( $ value , $ options ) ; $ error = self :: getLastError ( ) ; if ( $ json === null || ! empty ( $ error ) ) { $ GLOBALS [ 'log' ] -> error ( 'Json::encode():' . $ error . ' - ' . print_r ( $ value , true ) ) ; } return $ json ; }
JSON encode a string

@param string $value
@param int $options Default 0
@return string
JSON encode a string