PHP Class DataSift\Storyplayer\OutputLib\DataFormatter

Datei anzeigen Open project: datasift/storyplayer

Public Methods

Method Description
convertData ( mixed $data ) : string convert data of any time to be a string, and truncate if required
convertMessageArray ( array | object $message ) : string convert an array of data to a single string for output, and truncate if required
getIsVerbose ( ) : boolean are we allowing the full length of the output?
setIsVerbose ( boolean $isVerbose = true ) we want to allow the full length of the output

Protected Methods

Method Description
truncateIfRequired ( string $logValue, boolean $alwaysVerbose = false ) : string truncate a string if it is too long

Method Details

convertData() public method

this string can then be safely written to the log file
public convertData ( mixed $data ) : string
$data mixed the data to be converted
return string the converted data

convertMessageArray() public method

convert an array of data to a single string for output, and truncate if required
public convertMessageArray ( array | object $message ) : string
$message array | object
return string the converted data

getIsVerbose() public method

are we allowing the full length of the output?
public getIsVerbose ( ) : boolean
return boolean

setIsVerbose() public method

we want to allow the full length of the output
public setIsVerbose ( boolean $isVerbose = true )
$isVerbose boolean should we allow the full length of the output?

truncateIfRequired() protected method

truncates the input string to a maximum of 100 chars, unless either: - $alwaysVerbose is TRUE, or - $this->getIsVerbose() is TRUE we use this to avoid filling the log file with megabytes of output when var_dump()ing some internal objects
protected truncateIfRequired ( string $logValue, boolean $alwaysVerbose = false ) : string
$logValue string the input data that might need truncating
$alwaysVerbose boolean if TRUE, overrides $this->getIsVerbose()
return string the (possibly) truncated input string