PHP 클래스 DataSift\Storyplayer\OutputLib\DataFormatter

저자: Stuart Herbert ([email protected])
파일 보기 프로젝트 열기: datasift/storyplayer

공개 메소드들

메소드 설명
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

보호된 메소드들

메소드 설명
truncateIfRequired ( string $logValue, boolean $alwaysVerbose = false ) : string truncate a string if it is too long

메소드 상세

convertData() 공개 메소드

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

convertMessageArray() 공개 메소드

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

getIsVerbose() 공개 메소드

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

setIsVerbose() 공개 메소드

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() 보호된 메소드

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()
리턴 string the (possibly) truncated input string