Stackdriver Debugger Client - Class Agent (1.9.0)

Reference documentation and code samples for the Stackdriver Debugger Client class Agent.

This class is responsible for registering all debugger breakpoints and logpoints for each request. It should be created as early as possible in your application.

Example:

use Google\Cloud\Debugger\Agent;

$agent = new Agent();

Namespace

Google \ Cloud \ Debugger

Methods

__construct

Create a new Debugger Agent, registers all breakpoints for collection or execution, and registers a shutdown function for reporting results.

Parameters
Name Description
options array

Configuration options.

↳ storage BreakpointStorageInterface

Breakpoint storage to fetch breakpoints from. Defaults to a new SysvBreakpointStorage instance.

↳ sourceRoot string

Path to the root of the source repository. Defaults to the directory of the calling file.

↳ logger LoggerInterface

PSR-3 compliant logger used to write logpoint records. Defaults to a new Stackdriver logger.

↳ daemonOptions array

Additional options to provide to the Daemon when registering.

↳ maxDepth int

Limits the number of stackframes with captured variables. To capture variables in all stackframes, set to PHP_INT_MAX. Defaults to 5.

↳ maxMemberDepth int

Maximum depth of member variables to capture. Defaults to 5.

↳ maxPayloadSize int

Maximum amount of space of captured data. Defaults to 32768.

↳ maxMembers int

Maximum number of member variables captured per variable. Defaults to 1000.

↳ maxValueLength int

Maximum length of the string representing the captured variable. Defaults to 500.

handleSnapshot

Callback for reporting a snapshot.

Parameters
Name Description
snapshot array

Snapshot data

↳ id string

The breakpoint id of the snapshot

↳ evaluatedExpressions array

The results of evaluating the snapshot's expressions

↳ stackframes array

List of captured stackframe data.

handleLogpoint

Callback for reporting a logpoint.

Parameters
Name Description
level mixed
message string
context array
Returns
Type Description
void

reportBreakpoints

Callback for batch runner to report a breakpoint.

Parameter
Name Description
breakpointsInfo array

Constants

DEFAULT_LOGPOINT_LOG_NAME

Value: 'debugger_logpoints'

DEFAULT_APP_ENGINE_LOG_NAME

Value: 'appengine.googleapis.com%2Frequest_log'

DEFAULT_MAX_DEPTH

Value: 5