public function getLogs(GetLogsRequest $request)
    {
        $headers = array();
        $params  = array();
        if ($request->getTopic() !== null) {
            $params ['topic'] = $request->getTopic();
        }
        if ($request->getFrom() !== null) {
            $params ['from'] = $request->getFrom();
        }
        if ($request->getTo() !== null) {
            $params ['to'] = $request->getTo();
        }
        if ($request->getQuery() !== null) {
            $params ['query'] = $request->getQuery();
        }
        $params ['type'] = 'log';
        if ($request->getLine() !== null) {
            $params ['line'] = $request->getLine();
        }
        if ($request->getOffset() !== null) {
            $params ['offset'] = $request->getOffset();
        }
        if ($request->getOffset() !== null) {
            $params ['reverse'] = $request->getReverse() ? 'true' : 'false';
        }

        $project  = $request->getProject() ?: '';
        $logStore = $request->getLogStore() ?: '';

        $resource = "/logstores/$logStore";
        list ( $resp, $header ) = $this->send("GET", $project, null, $resource, $params, $headers);

        $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
        $resp      = $this->parseToJson($resp, $requestId);

        return new GetLogsResponse ($resp, $header);
    }
public function getLogs(GetLogsRequest $request)
    {
        $headers = array();
        $params  = array();
        if ($request->getTopic() !== null) {
            $params ['topic'] = $request->getTopic();
        }
        if ($request->getFrom() !== null) {
            $params ['from'] = $request->getFrom();
        }
        if ($request->getTo() !== null) {
            $params ['to'] = $request->getTo();
        }
        if ($request->getQuery() !== null) {
            $params ['query'] = $request->getQuery();
        }
        $params ['type'] = 'log';
        if ($request->getLine() !== null) {
            $params ['line'] = $request->getLine();
        }
        if ($request->getOffset() !== null) {
            $params ['offset'] = $request->getOffset();
        }
        if ($request->getOffset() !== null) {
            $params ['reverse'] = $request->getReverse() ? 'true' : 'false';
        }

        $project  = $request->getProject() ?: '';
        $logStore = $request->getLogStore() ?: '';

        $resource = "/logstores/$logStore";
        list ( $resp, $header ) = $this->send("GET", $project, null, $resource, $params, $headers);

        $requestId = isset ( $header ['x-log-requestid'] ) ? $header ['x-log-requestid'] : '';
        $resp      = $this->parseToJson($resp, $requestId);

        return new GetLogsResponse ($resp, $header);
    }
public function getLogs ( GetLogsRequest $ request ) { $ headers = array ( ) ; $ params = array ( ) ; if ( $ request -> getTopic ( ) !== null ) { $ params [ 'topic' ] = $ request -> getTopic ( ) ; } if ( $ request -> getFrom ( ) !== null ) { $ params [ 'from' ] = $ request -> getFrom ( ) ; } if ( $ request -> getTo ( ) !== null ) { $ params [ 'to' ] = $ request -> getTo ( ) ; } if ( $ request -> getQuery ( ) !== null ) { $ params [ 'query' ] = $ request -> getQuery ( ) ; } $ params [ 'type' ] = 'log' ; if ( $ request -> getLine ( ) !== null ) { $ params [ 'line' ] = $ request -> getLine ( ) ; } if ( $ request -> getOffset ( ) !== null ) { $ params [ 'offset' ] = $ request -> getOffset ( ) ; } if ( $ request -> getOffset ( ) !== null ) { $ params [ 'reverse' ] = $ request -> getReverse ( ) ? 'true' : 'false' ; } $ project = $ request -> getProject ( ) ? : '' ; $ logStore = $ request -> getLogStore ( ) ? : '' ; $ resource = "/logstores/$logStore" ; list ( $ resp , $ header ) = $ this -> send ( "GET" , $ project , null , $ resource , $ params , $ headers ) ; $ requestId = isset ( $ header [ 'x-log-requestid' ] ) ? $ header [ 'x-log-requestid' ] : '' ; $ resp = $ this -> parseToJson ( $ resp , $ requestId ) ; return new GetLogsResponse ( $ resp , $ header ) ; }
Get logs from Log service.
Unsuccessful operation will cause an Exception.

@param GetLogsRequest $request the GetLogs request parameters class.

@throws Exception
@return GetLogsResponse
Get logs from Log service . Unsuccessful operation will cause an Exception .