Changeset 816
- Timestamp:
- 08/14/07 16:47:15 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/util/log/stubBaseLogData.php
r388 r816 42 42 */ 43 43 protected $logData = array(); 44 44 45 45 /** 46 46 * constructor … … 65 65 ); 66 66 } 67 67 68 68 /** 69 69 * adds data to the log object … … 78 78 { 79 79 settype($data, 'string'); 80 $this->logData[] = str_replace(chr(13), '', str_replace("\n", '<nl>', str_replace(stubLogData::SEPERATOR, '', $data)));80 $this->logData[] = $this->escapeData($data); 81 81 } 82 82 83 /** 84 * helper method that escapes the data to be logged 85 * 86 * @param string $data 87 * @return string 88 */ 89 protected function escapeData($data) 90 { 91 return str_replace(chr(13), '', str_replace("\n", '<nl>', str_replace(stubLogData::SEPERATOR, '', $data))); 92 } 93 83 94 /** 84 95 * returns the whole log data as one line … … 90 101 return join(stubLogData::SEPERATOR, $this->logData); 91 102 } 92 103 93 104 /** 94 105 * returns the log level of the log data … … 101 112 return $this->level; 102 113 } 103 114 104 115 /** 105 116 * returns the target where the log data should go to
