Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/worker/src/Gelf
File: Message.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class Gelf_Message
[2] Fix | Delete
{
[3] Fix | Delete
/**#@+
[4] Fix | Delete
* Log levels according to syslog priority
[5] Fix | Delete
*/
[6] Fix | Delete
const EMERGENCY = 0;
[7] Fix | Delete
const ALERT = 1;
[8] Fix | Delete
const CRITICAL = 2;
[9] Fix | Delete
const ERROR = 3;
[10] Fix | Delete
const WARNING = 4;
[11] Fix | Delete
const NOTICE = 5;
[12] Fix | Delete
const INFO = 6;
[13] Fix | Delete
const DEBUG = 7;
[14] Fix | Delete
/**#@-*/
[15] Fix | Delete
[16] Fix | Delete
/**
[17] Fix | Delete
* @var string
[18] Fix | Delete
*/
[19] Fix | Delete
private $version = null;
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* @var integer
[23] Fix | Delete
*/
[24] Fix | Delete
private $timestamp = null;
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* @var string
[28] Fix | Delete
*/
[29] Fix | Delete
private $shortMessage = null;
[30] Fix | Delete
[31] Fix | Delete
/**
[32] Fix | Delete
* @var string
[33] Fix | Delete
*/
[34] Fix | Delete
private $fullMessage = null;
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* @var string
[38] Fix | Delete
*/
[39] Fix | Delete
private $facility = null;
[40] Fix | Delete
[41] Fix | Delete
/**
[42] Fix | Delete
* @var string
[43] Fix | Delete
*/
[44] Fix | Delete
private $host = null;
[45] Fix | Delete
[46] Fix | Delete
/**
[47] Fix | Delete
* @var integer
[48] Fix | Delete
*/
[49] Fix | Delete
private $level = null;
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* @var string
[53] Fix | Delete
*/
[54] Fix | Delete
private $file = null;
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* @var integer
[58] Fix | Delete
*/
[59] Fix | Delete
private $line = null;
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* @var array
[63] Fix | Delete
*/
[64] Fix | Delete
private $data = array();
[65] Fix | Delete
[66] Fix | Delete
/**
[67] Fix | Delete
* @param string $version
[68] Fix | Delete
*
[69] Fix | Delete
* @return Gelf_Message
[70] Fix | Delete
*/
[71] Fix | Delete
public function setVersion($version)
[72] Fix | Delete
{
[73] Fix | Delete
$this->version = $version;
[74] Fix | Delete
[75] Fix | Delete
return $this;
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
/**
[79] Fix | Delete
* @return string
[80] Fix | Delete
*/
[81] Fix | Delete
public function getVersion()
[82] Fix | Delete
{
[83] Fix | Delete
return $this->version;
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* @param integer $timestamp
[88] Fix | Delete
*
[89] Fix | Delete
* @return Gelf_Message
[90] Fix | Delete
*/
[91] Fix | Delete
public function setTimestamp($timestamp)
[92] Fix | Delete
{
[93] Fix | Delete
$this->timestamp = $timestamp;
[94] Fix | Delete
[95] Fix | Delete
return $this;
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
/**
[99] Fix | Delete
* @return integer
[100] Fix | Delete
*/
[101] Fix | Delete
public function getTimestamp()
[102] Fix | Delete
{
[103] Fix | Delete
return $this->timestamp;
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* @param string $shortMessage
[108] Fix | Delete
*
[109] Fix | Delete
* @return Gelf_Message
[110] Fix | Delete
*/
[111] Fix | Delete
public function setShortMessage($shortMessage)
[112] Fix | Delete
{
[113] Fix | Delete
$this->shortMessage = $shortMessage;
[114] Fix | Delete
[115] Fix | Delete
return $this;
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
/**
[119] Fix | Delete
* @return string
[120] Fix | Delete
*/
[121] Fix | Delete
public function getShortMessage()
[122] Fix | Delete
{
[123] Fix | Delete
return $this->shortMessage;
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
/**
[127] Fix | Delete
* @param string $fullMessage
[128] Fix | Delete
*
[129] Fix | Delete
* @return Gelf_Message
[130] Fix | Delete
*/
[131] Fix | Delete
public function setFullMessage($fullMessage)
[132] Fix | Delete
{
[133] Fix | Delete
$this->fullMessage = $fullMessage;
[134] Fix | Delete
[135] Fix | Delete
return $this;
[136] Fix | Delete
}
[137] Fix | Delete
[138] Fix | Delete
/**
[139] Fix | Delete
* @return string
[140] Fix | Delete
*/
[141] Fix | Delete
public function getFullMessage()
[142] Fix | Delete
{
[143] Fix | Delete
return $this->fullMessage;
[144] Fix | Delete
}
[145] Fix | Delete
[146] Fix | Delete
/**
[147] Fix | Delete
* @param string $facility
[148] Fix | Delete
*
[149] Fix | Delete
* @return Gelf_Message
[150] Fix | Delete
*/
[151] Fix | Delete
public function setFacility($facility)
[152] Fix | Delete
{
[153] Fix | Delete
$this->facility = $facility;
[154] Fix | Delete
[155] Fix | Delete
return $this;
[156] Fix | Delete
}
[157] Fix | Delete
[158] Fix | Delete
/**
[159] Fix | Delete
* @return string
[160] Fix | Delete
*/
[161] Fix | Delete
public function getFacility()
[162] Fix | Delete
{
[163] Fix | Delete
return $this->facility;
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
/**
[167] Fix | Delete
* @param string $host
[168] Fix | Delete
*
[169] Fix | Delete
* @return Gelf_Message
[170] Fix | Delete
*/
[171] Fix | Delete
public function setHost($host)
[172] Fix | Delete
{
[173] Fix | Delete
$this->host = $host;
[174] Fix | Delete
[175] Fix | Delete
return $this;
[176] Fix | Delete
}
[177] Fix | Delete
[178] Fix | Delete
/**
[179] Fix | Delete
* @return string
[180] Fix | Delete
*/
[181] Fix | Delete
public function getHost()
[182] Fix | Delete
{
[183] Fix | Delete
return $this->host;
[184] Fix | Delete
}
[185] Fix | Delete
[186] Fix | Delete
/**
[187] Fix | Delete
* @param integer $level
[188] Fix | Delete
*
[189] Fix | Delete
* @return Gelf_Message
[190] Fix | Delete
*/
[191] Fix | Delete
public function setLevel($level)
[192] Fix | Delete
{
[193] Fix | Delete
$this->level = $level;
[194] Fix | Delete
[195] Fix | Delete
return $this;
[196] Fix | Delete
}
[197] Fix | Delete
[198] Fix | Delete
/**
[199] Fix | Delete
* @return integer
[200] Fix | Delete
*/
[201] Fix | Delete
public function getLevel()
[202] Fix | Delete
{
[203] Fix | Delete
return $this->level;
[204] Fix | Delete
}
[205] Fix | Delete
[206] Fix | Delete
/**
[207] Fix | Delete
* @param string $file
[208] Fix | Delete
*
[209] Fix | Delete
* @return Gelf_Message
[210] Fix | Delete
*/
[211] Fix | Delete
public function setFile($file)
[212] Fix | Delete
{
[213] Fix | Delete
$this->file = $file;
[214] Fix | Delete
[215] Fix | Delete
return $this;
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
/**
[219] Fix | Delete
* @return string
[220] Fix | Delete
*/
[221] Fix | Delete
public function getFile()
[222] Fix | Delete
{
[223] Fix | Delete
return $this->file;
[224] Fix | Delete
}
[225] Fix | Delete
[226] Fix | Delete
/**
[227] Fix | Delete
* @param integer $line
[228] Fix | Delete
*
[229] Fix | Delete
* @return Gelf_Message
[230] Fix | Delete
*/
[231] Fix | Delete
public function setLine($line)
[232] Fix | Delete
{
[233] Fix | Delete
$this->line = $line;
[234] Fix | Delete
[235] Fix | Delete
return $this;
[236] Fix | Delete
}
[237] Fix | Delete
[238] Fix | Delete
/**
[239] Fix | Delete
* @return integer
[240] Fix | Delete
*/
[241] Fix | Delete
public function getLine()
[242] Fix | Delete
{
[243] Fix | Delete
return $this->line;
[244] Fix | Delete
}
[245] Fix | Delete
[246] Fix | Delete
/**
[247] Fix | Delete
* @param string $key
[248] Fix | Delete
* @param mixed $value
[249] Fix | Delete
*
[250] Fix | Delete
* @return Gelf_Message
[251] Fix | Delete
*/
[252] Fix | Delete
public function setAdditional($key, $value)
[253] Fix | Delete
{
[254] Fix | Delete
$this->data["_".trim($key)] = $value;
[255] Fix | Delete
[256] Fix | Delete
return $this;
[257] Fix | Delete
}
[258] Fix | Delete
[259] Fix | Delete
/**
[260] Fix | Delete
* @return mixed
[261] Fix | Delete
*/
[262] Fix | Delete
public function getAdditional($key)
[263] Fix | Delete
{
[264] Fix | Delete
$additional_key = "_".trim($key);
[265] Fix | Delete
[266] Fix | Delete
return isset($this->data[$additional_key]) ? $this->data[$additional_key] : null;
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
/**
[270] Fix | Delete
* @return array
[271] Fix | Delete
*/
[272] Fix | Delete
public function toArray()
[273] Fix | Delete
{
[274] Fix | Delete
$messageAsArray = array(
[275] Fix | Delete
'version' => $this->getVersion(),
[276] Fix | Delete
'timestamp' => $this->getTimestamp(),
[277] Fix | Delete
'short_message' => $this->getShortMessage(),
[278] Fix | Delete
'full_message' => $this->getFullMessage(),
[279] Fix | Delete
'facility' => $this->getFacility(),
[280] Fix | Delete
'host' => $this->getHost(),
[281] Fix | Delete
'level' => $this->getLevel(),
[282] Fix | Delete
'file' => $this->getFile(),
[283] Fix | Delete
'line' => $this->getLine(),
[284] Fix | Delete
);
[285] Fix | Delete
[286] Fix | Delete
foreach ($this->data as $key => $value) {
[287] Fix | Delete
$messageAsArray[$key] = $value;
[288] Fix | Delete
}
[289] Fix | Delete
[290] Fix | Delete
return $messageAsArray;
[291] Fix | Delete
}
[292] Fix | Delete
}
[293] Fix | Delete
[294] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function