PageRenderTime 50ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/script/lib/Log.php

https://bitbucket.org/gugli/chamilo-dev
PHP | 843 lines | 283 code | 65 blank | 495 comment | 27 complexity | 9c3093723cbbeca00c4cc790cb08b25a MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1, LGPL-3.0, GPL-3.0, MIT, GPL-2.0
  1. <?php
  2. /**
  3. * $Header$
  4. * $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $
  5. *
  6. * @version $Revision: 302787 $
  7. * @package Log
  8. */
  9. define('PEAR_LOG_EMERG', 0); /* System is unusable */
  10. define('PEAR_LOG_ALERT', 1); /* Immediate action required */
  11. define('PEAR_LOG_CRIT', 2); /* Critical conditions */
  12. define('PEAR_LOG_ERR', 3); /* Error conditions */
  13. define('PEAR_LOG_WARNING', 4); /* Warning conditions */
  14. define('PEAR_LOG_NOTICE', 5); /* Normal but significant */
  15. define('PEAR_LOG_INFO', 6); /* Informational */
  16. define('PEAR_LOG_DEBUG', 7); /* Debug-level messages */
  17. define('PEAR_LOG_ALL', 0xffffffff); /* All messages */
  18. define('PEAR_LOG_NONE', 0x00000000); /* No message */
  19. /* Log types for PHP's native error_log() function. */
  20. define('PEAR_LOG_TYPE_SYSTEM', 0); /* Use PHP's system logger */
  21. define('PEAR_LOG_TYPE_MAIL', 1); /* Use PHP's mail() function */
  22. define('PEAR_LOG_TYPE_DEBUG', 2); /* Use PHP's debugging connection */
  23. define('PEAR_LOG_TYPE_FILE', 3); /* Append to a file */
  24. define('PEAR_LOG_TYPE_SAPI', 4); /* Use the SAPI logging handler */
  25. /**
  26. * The Log:: class implements both an abstraction for various logging
  27. * mechanisms and the Subject end of a Subject-Observer pattern.
  28. *
  29. * @author Chuck Hagenbuch <chuck@horde.org>
  30. * @author Jon Parise <jon@php.net>
  31. * @since Horde 1.3
  32. * @package Log
  33. */
  34. class Log
  35. {
  36. /**
  37. * Indicates whether or not the log can been opened / connected.
  38. *
  39. * @var boolean
  40. * @access protected
  41. */
  42. var $_opened = false;
  43. /**
  44. * Instance-specific unique identification number.
  45. *
  46. * @var integer
  47. * @access protected
  48. */
  49. var $_id = 0;
  50. /**
  51. * The label that uniquely identifies this set of log messages.
  52. *
  53. * @var string
  54. * @access protected
  55. */
  56. var $_ident = '';
  57. /**
  58. * The default priority to use when logging an event.
  59. *
  60. * @var integer
  61. * @access protected
  62. */
  63. var $_priority = PEAR_LOG_INFO;
  64. /**
  65. * The bitmask of allowed log levels.
  66. *
  67. * @var integer
  68. * @access protected
  69. */
  70. var $_mask = PEAR_LOG_ALL;
  71. /**
  72. * Holds all Log_observer objects that wish to be notified of new messages.
  73. *
  74. * @var array
  75. * @access protected
  76. */
  77. var $_listeners = array();
  78. /**
  79. * Maps canonical format keys to position arguments for use in building
  80. * "line format" strings.
  81. *
  82. * @var array
  83. * @access protected
  84. */
  85. var $_formatMap = array('%{timestamp}' => '%1$s', '%{ident}' => '%2$s', '%{priority}' => '%3$s',
  86. '%{message}' => '%4$s', '%{file}' => '%5$s', '%{line}' => '%6$s', '%{function}' => '%7$s',
  87. '%{class}' => '%8$s', '%\{' => '%%{');
  88. /**
  89. * Attempts to return a concrete Log instance of type $handler.
  90. *
  91. * @param string $handler The type of concrete Log subclass to return.
  92. * Attempt to dynamically include the code for
  93. * this subclass. Currently, valid values are
  94. * 'console', 'syslog', 'sql', 'file', and 'mcal'.
  95. *
  96. * @param string $name The name of the actually log file, table, or
  97. * other specific store to use. Defaults to an
  98. * empty string, with which the subclass will
  99. * attempt to do something intelligent.
  100. *
  101. * @param string $ident The identity reported to the log system.
  102. *
  103. * @param array $conf A hash containing any additional configuration
  104. * information that a subclass might need.
  105. *
  106. * @param int $level Log messages up to and including this level.
  107. *
  108. * @return object Log The newly created concrete Log instance, or
  109. * null on an error.
  110. * @access public
  111. * @since Log 1.0
  112. */
  113. public static function factory($handler, $name = '', $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
  114. {
  115. $handler = strtolower($handler);
  116. $class = 'Log_' . $handler;
  117. $classfile = 'Log/' . $handler . '.php';
  118. /*
  119. * Attempt to include our version of the named class, but don't treat
  120. * a failure as fatal. The caller may have already included their own
  121. * version of the named class.
  122. */
  123. if (! class_exists($class, false))
  124. {
  125. include_once $classfile;
  126. }
  127. /* If the class exists, return a new instance of it. */
  128. if (class_exists($class, false))
  129. {
  130. $obj = new $class($name, $ident, $conf, $level);
  131. return $obj;
  132. }
  133. $null = null;
  134. return $null;
  135. }
  136. /**
  137. * Attempts to return a reference to a concrete Log instance of type
  138. * $handler, only creating a new instance if no log instance with the same
  139. * parameters currently exists.
  140. *
  141. * You should use this if there are multiple places you might create a
  142. * logger, you don't want to create multiple loggers, and you don't want to
  143. * check for the existance of one each time. The singleton pattern does all
  144. * the checking work for you.
  145. *
  146. * <b>You MUST call this method with the $var = &Log::singleton() syntax.
  147. * Without the ampersand (&) in front of the method name, you will not get
  148. * a reference, you will get a copy.</b>
  149. *
  150. * @param string $handler The type of concrete Log subclass to return.
  151. * Attempt to dynamically include the code for
  152. * this subclass. Currently, valid values are
  153. * 'console', 'syslog', 'sql', 'file', and 'mcal'.
  154. *
  155. * @param string $name The name of the actually log file, table, or
  156. * other specific store to use. Defaults to an
  157. * empty string, with which the subclass will
  158. * attempt to do something intelligent.
  159. *
  160. * @param string $ident The identity reported to the log system.
  161. *
  162. * @param array $conf A hash containing any additional configuration
  163. * information that a subclass might need.
  164. *
  165. * @param int $level Log messages up to and including this level.
  166. *
  167. * @return object Log The newly created concrete Log instance, or
  168. * null on an error.
  169. * @access public
  170. * @since Log 1.0
  171. */
  172. public static function singleton($handler, $name = '', $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG)
  173. {
  174. static $instances;
  175. if (! isset($instances))
  176. $instances = array();
  177. $signature = serialize(array($handler, $name, $ident, $conf, $level));
  178. if (! isset($instances[$signature]))
  179. {
  180. $instances[$signature] = Log :: factory($handler, $name, $ident, $conf, $level);
  181. }
  182. return $instances[$signature];
  183. }
  184. /**
  185. * Abstract implementation of the open() method.
  186. * @since Log 1.0
  187. */
  188. function open()
  189. {
  190. return false;
  191. }
  192. /**
  193. * Abstract implementation of the close() method.
  194. * @since Log 1.0
  195. */
  196. function close()
  197. {
  198. return false;
  199. }
  200. /**
  201. * Abstract implementation of the flush() method.
  202. * @since Log 1.8.2
  203. */
  204. function flush()
  205. {
  206. return false;
  207. }
  208. /**
  209. * Abstract implementation of the log() method.
  210. * @since Log 1.0
  211. */
  212. function log($message, $priority = null)
  213. {
  214. return false;
  215. }
  216. /**
  217. * A convenience function for logging a emergency event. It will log a
  218. * message at the PEAR_LOG_EMERG log level.
  219. *
  220. * @param mixed $message String or object containing the message
  221. * to log.
  222. *
  223. * @return boolean True if the message was successfully logged.
  224. *
  225. * @access public
  226. * @since Log 1.7.0
  227. */
  228. function emerg($message)
  229. {
  230. return $this->log($message, PEAR_LOG_EMERG);
  231. }
  232. /**
  233. * A convenience function for logging an alert event. It will log a
  234. * message at the PEAR_LOG_ALERT log level.
  235. *
  236. * @param mixed $message String or object containing the message
  237. * to log.
  238. *
  239. * @return boolean True if the message was successfully logged.
  240. *
  241. * @access public
  242. * @since Log 1.7.0
  243. */
  244. function alert($message)
  245. {
  246. return $this->log($message, PEAR_LOG_ALERT);
  247. }
  248. /**
  249. * A convenience function for logging a critical event. It will log a
  250. * message at the PEAR_LOG_CRIT log level.
  251. *
  252. * @param mixed $message String or object containing the message
  253. * to log.
  254. *
  255. * @return boolean True if the message was successfully logged.
  256. *
  257. * @access public
  258. * @since Log 1.7.0
  259. */
  260. function crit($message)
  261. {
  262. return $this->log($message, PEAR_LOG_CRIT);
  263. }
  264. /**
  265. * A convenience function for logging a error event. It will log a
  266. * message at the PEAR_LOG_ERR log level.
  267. *
  268. * @param mixed $message String or object containing the message
  269. * to log.
  270. *
  271. * @return boolean True if the message was successfully logged.
  272. *
  273. * @access public
  274. * @since Log 1.7.0
  275. */
  276. function err($message)
  277. {
  278. return $this->log($message, PEAR_LOG_ERR);
  279. }
  280. /**
  281. * A convenience function for logging a warning event. It will log a
  282. * message at the PEAR_LOG_WARNING log level.
  283. *
  284. * @param mixed $message String or object containing the message
  285. * to log.
  286. *
  287. * @return boolean True if the message was successfully logged.
  288. *
  289. * @access public
  290. * @since Log 1.7.0
  291. */
  292. function warning($message)
  293. {
  294. return $this->log($message, PEAR_LOG_WARNING);
  295. }
  296. /**
  297. * A convenience function for logging a notice event. It will log a
  298. * message at the PEAR_LOG_NOTICE log level.
  299. *
  300. * @param mixed $message String or object containing the message
  301. * to log.
  302. *
  303. * @return boolean True if the message was successfully logged.
  304. *
  305. * @access public
  306. * @since Log 1.7.0
  307. */
  308. function notice($message)
  309. {
  310. return $this->log($message, PEAR_LOG_NOTICE);
  311. }
  312. /**
  313. * A convenience function for logging a information event. It will log a
  314. * message at the PEAR_LOG_INFO log level.
  315. *
  316. * @param mixed $message String or object containing the message
  317. * to log.
  318. *
  319. * @return boolean True if the message was successfully logged.
  320. *
  321. * @access public
  322. * @since Log 1.7.0
  323. */
  324. function info($message)
  325. {
  326. return $this->log($message, PEAR_LOG_INFO);
  327. }
  328. /**
  329. * A convenience function for logging a debug event. It will log a
  330. * message at the PEAR_LOG_DEBUG log level.
  331. *
  332. * @param mixed $message String or object containing the message
  333. * to log.
  334. *
  335. * @return boolean True if the message was successfully logged.
  336. *
  337. * @access public
  338. * @since Log 1.7.0
  339. */
  340. function debug($message)
  341. {
  342. return $this->log($message, PEAR_LOG_DEBUG);
  343. }
  344. /**
  345. * Returns the string representation of the message data.
  346. *
  347. * If $message is an object, _extractMessage() will attempt to extract
  348. * the message text using a known method (such as a PEAR_Error object's
  349. * getMessage() method). If a known method, cannot be found, the
  350. * serialized representation of the object will be returned.
  351. *
  352. * If the message data is already a string, it will be returned unchanged.
  353. *
  354. * @param mixed $message The original message data. This may be a
  355. * string or any object.
  356. *
  357. * @return string The string representation of the message.
  358. *
  359. * @access protected
  360. */
  361. function _extractMessage($message)
  362. {
  363. /*
  364. * If we've been given an object, attempt to extract the message using
  365. * a known method. If we can't find such a method, default to the
  366. * "human-readable" version of the object.
  367. *
  368. * We also use the human-readable format for arrays.
  369. */
  370. if (is_object($message))
  371. {
  372. if (method_exists($message, 'getmessage'))
  373. {
  374. $message = $message->getMessage();
  375. }
  376. else
  377. if (method_exists($message, 'tostring'))
  378. {
  379. $message = $message->toString();
  380. }
  381. else
  382. if (method_exists($message, '__tostring'))
  383. {
  384. $message = (string) $message;
  385. }
  386. else
  387. {
  388. $message = var_export($message, true);
  389. }
  390. }
  391. else
  392. if (is_array($message))
  393. {
  394. if (isset($message['message']))
  395. {
  396. if (is_scalar($message['message']))
  397. {
  398. $message = $message['message'];
  399. }
  400. else
  401. {
  402. $message = var_export($message['message'], true);
  403. }
  404. }
  405. else
  406. {
  407. $message = var_export($message, true);
  408. }
  409. }
  410. else
  411. if (is_bool($message) || $message === NULL)
  412. {
  413. $message = var_export($message, true);
  414. }
  415. /* Otherwise, we assume the message is a string. */
  416. return $message;
  417. }
  418. /**
  419. * Using debug_backtrace(), returns the file, line, and enclosing function
  420. * name of the source code context from which log() was invoked.
  421. *
  422. * @param int $depth The initial number of frames we should step
  423. * back into the trace.
  424. *
  425. * @return array Array containing four strings: the filename, the line,
  426. * the function name, and the class name from which log()
  427. * was called.
  428. *
  429. * @access private
  430. * @since Log 1.9.4
  431. */
  432. function _getBacktraceVars($depth)
  433. {
  434. /* Start by generating a backtrace from the current call (here). */
  435. $bt = debug_backtrace();
  436. /* Store some handy shortcuts to our previous frames. */
  437. $bt0 = isset($bt[$depth]) ? $bt[$depth] : null;
  438. $bt1 = isset($bt[$depth + 1]) ? $bt[$depth + 1] : null;
  439. /*
  440. * If we were ultimately invoked by the composite handler, we need to
  441. * increase our depth one additional level to compensate.
  442. */
  443. $class = isset($bt1['class']) ? $bt1['class'] : null;
  444. if ($class !== null && strcasecmp($class, 'Log_composite') == 0)
  445. {
  446. $depth ++;
  447. $bt0 = isset($bt[$depth]) ? $bt[$depth] : null;
  448. $bt1 = isset($bt[$depth + 1]) ? $bt[$depth + 1] : null;
  449. $class = isset($bt1['class']) ? $bt1['class'] : null;
  450. }
  451. /*
  452. * We're interested in the frame which invoked the log() function, so
  453. * we need to walk back some number of frames into the backtrace. The
  454. * $depth parameter tells us where to start looking. We go one step
  455. * further back to find the name of the encapsulating function from
  456. * which log() was called.
  457. */
  458. $file = isset($bt0) ? $bt0['file'] : null;
  459. $line = isset($bt0) ? $bt0['line'] : 0;
  460. $func = isset($bt1) ? $bt1['function'] : null;
  461. /*
  462. * However, if log() was called from one of our "shortcut" functions,
  463. * we're going to need to go back an additional step.
  464. */
  465. if (in_array($func, array('emerg', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug')))
  466. {
  467. $bt2 = isset($bt[$depth + 2]) ? $bt[$depth + 2] : null;
  468. $file = is_array($bt1) ? $bt1['file'] : null;
  469. $line = is_array($bt1) ? $bt1['line'] : 0;
  470. $func = is_array($bt2) ? $bt2['function'] : null;
  471. $class = isset($bt2['class']) ? $bt2['class'] : null;
  472. }
  473. /*
  474. * If we couldn't extract a function name (perhaps because we were
  475. * executed from the "main" context), provide a default value.
  476. */
  477. if ($func === null)
  478. {
  479. $func = '(none)';
  480. }
  481. /* Return a 4-tuple containing (file, line, function, class). */
  482. return array($file, $line, $func, $class);
  483. }
  484. /**
  485. * Produces a formatted log line based on a format string and a set of
  486. * variables representing the current log record and state.
  487. *
  488. * @return string Formatted log string.
  489. *
  490. * @access protected
  491. * @since Log 1.9.4
  492. */
  493. function _format($format, $timestamp, $priority, $message)
  494. {
  495. /*
  496. * If the format string references any of the backtrace-driven
  497. * variables (%5 %6,%7,%8), generate the backtrace and fetch them.
  498. */
  499. if (preg_match('/%[5678]/', $format))
  500. {
  501. list($file, $line, $func, $class) = $this->_getBacktraceVars(2);
  502. }
  503. /*
  504. * Build the formatted string. We use the sprintf() function's
  505. * "argument swapping" capability to dynamically select and position
  506. * the variables which will ultimately appear in the log string.
  507. */
  508. return sprintf($format, $timestamp, $this->_ident, $this->priorityToString($priority), $message, isset($file) ? $file : '', isset($line) ? $line : '', isset($func) ? $func : '', isset($class) ? $class : '');
  509. }
  510. /**
  511. * Returns the string representation of a PEAR_LOG_* integer constant.
  512. *
  513. * @param int $priority A PEAR_LOG_* integer constant.
  514. *
  515. * @return string The string representation of $level.
  516. *
  517. * @access public
  518. * @since Log 1.0
  519. */
  520. function priorityToString($priority)
  521. {
  522. $levels = array(PEAR_LOG_EMERG => 'emergency', PEAR_LOG_ALERT => 'alert', PEAR_LOG_CRIT => 'critical',
  523. PEAR_LOG_ERR => 'error', PEAR_LOG_WARNING => 'warning', PEAR_LOG_NOTICE => 'notice',
  524. PEAR_LOG_INFO => 'info', PEAR_LOG_DEBUG => 'debug');
  525. return $levels[$priority];
  526. }
  527. /**
  528. * Returns the the PEAR_LOG_* integer constant for the given string
  529. * representation of a priority name. This function performs a
  530. * case-insensitive search.
  531. *
  532. * @param string $name String containing a priority name.
  533. *
  534. * @return string The PEAR_LOG_* integer contstant corresponding
  535. * the the specified priority name.
  536. *
  537. * @access public
  538. * @since Log 1.9.0
  539. */
  540. function stringToPriority($name)
  541. {
  542. $levels = array('emergency' => PEAR_LOG_EMERG, 'alert' => PEAR_LOG_ALERT, 'critical' => PEAR_LOG_CRIT,
  543. 'error' => PEAR_LOG_ERR, 'warning' => PEAR_LOG_WARNING, 'notice' => PEAR_LOG_NOTICE,
  544. 'info' => PEAR_LOG_INFO, 'debug' => PEAR_LOG_DEBUG);
  545. return $levels[strtolower($name)];
  546. }
  547. /**
  548. * Calculate the log mask for the given priority.
  549. *
  550. * This method may be called statically.
  551. *
  552. * @param integer $priority The priority whose mask will be calculated.
  553. *
  554. * @return integer The calculated log mask.
  555. *
  556. * @access public
  557. * @since Log 1.7.0
  558. */
  559. public static function MASK($priority)
  560. {
  561. return (1 << $priority);
  562. }
  563. /**
  564. * Calculate the log mask for all priorities up to the given priority.
  565. *
  566. * This method may be called statically.
  567. *
  568. * @param integer $priority The maximum priority covered by this mask.
  569. *
  570. * @return integer The resulting log mask.
  571. *
  572. * @access public
  573. * @since Log 1.7.0
  574. *
  575. * @deprecated deprecated since Log 1.9.4; use Log::MAX() instead
  576. */
  577. public static function UPTO($priority)
  578. {
  579. return Log :: MAX($priority);
  580. }
  581. /**
  582. * Calculate the log mask for all priorities greater than or equal to the
  583. * given priority. In other words, $priority will be the lowest priority
  584. * matched by the resulting mask.
  585. *
  586. * This method may be called statically.
  587. *
  588. * @param integer $priority The minimum priority covered by this mask.
  589. *
  590. * @return integer The resulting log mask.
  591. *
  592. * @access public
  593. * @since Log 1.9.4
  594. */
  595. public static function MIN($priority)
  596. {
  597. return PEAR_LOG_ALL ^ ((1 << $priority) - 1);
  598. }
  599. /**
  600. * Calculate the log mask for all priorities less than or equal to the
  601. * given priority. In other words, $priority will be the highests priority
  602. * matched by the resulting mask.
  603. *
  604. * This method may be called statically.
  605. *
  606. * @param integer $priority The maximum priority covered by this mask.
  607. *
  608. * @return integer The resulting log mask.
  609. *
  610. * @access public
  611. * @since Log 1.9.4
  612. */
  613. public static function MAX($priority)
  614. {
  615. return ((1 << ($priority + 1)) - 1);
  616. }
  617. /**
  618. * Set and return the level mask for the current Log instance.
  619. *
  620. * @param integer $mask A bitwise mask of log levels.
  621. *
  622. * @return integer The current level mask.
  623. *
  624. * @access public
  625. * @since Log 1.7.0
  626. */
  627. function setMask($mask)
  628. {
  629. $this->_mask = $mask;
  630. return $this->_mask;
  631. }
  632. /**
  633. * Returns the current level mask.
  634. *
  635. * @return interger The current level mask.
  636. *
  637. * @access public
  638. * @since Log 1.7.0
  639. */
  640. function getMask()
  641. {
  642. return $this->_mask;
  643. }
  644. /**
  645. * Check if the given priority is included in the current level mask.
  646. *
  647. * @param integer $priority The priority to check.
  648. *
  649. * @return boolean True if the given priority is included in the current
  650. * log mask.
  651. *
  652. * @access protected
  653. * @since Log 1.7.0
  654. */
  655. function _isMasked($priority)
  656. {
  657. return (Log :: MASK($priority) & $this->_mask);
  658. }
  659. /**
  660. * Returns the current default priority.
  661. *
  662. * @return integer The current default priority.
  663. *
  664. * @access public
  665. * @since Log 1.8.4
  666. */
  667. function getPriority()
  668. {
  669. return $this->_priority;
  670. }
  671. /**
  672. * Sets the default priority to the specified value.
  673. *
  674. * @param integer $priority The new default priority.
  675. *
  676. * @access public
  677. * @since Log 1.8.4
  678. */
  679. function setPriority($priority)
  680. {
  681. $this->_priority = $priority;
  682. }
  683. /**
  684. * Adds a Log_observer instance to the list of observers that are listening
  685. * for messages emitted by this Log instance.
  686. *
  687. * @param object $observer The Log_observer instance to attach as a
  688. * listener.
  689. *
  690. * @param boolean True if the observer is successfully attached.
  691. *
  692. * @access public
  693. * @since Log 1.0
  694. */
  695. function attach(&$observer)
  696. {
  697. if (! is_a($observer, 'Log_observer'))
  698. {
  699. return false;
  700. }
  701. $this->_listeners[$observer->_id] = &$observer;
  702. return true;
  703. }
  704. /**
  705. * Removes a Log_observer instance from the list of observers.
  706. *
  707. * @param object $observer The Log_observer instance to detach from
  708. * the list of listeners.
  709. *
  710. * @param boolean True if the observer is successfully detached.
  711. *
  712. * @access public
  713. * @since Log 1.0
  714. */
  715. function detach($observer)
  716. {
  717. if (! is_a($observer, 'Log_observer') || ! isset($this->_listeners[$observer->_id]))
  718. {
  719. return false;
  720. }
  721. unset($this->_listeners[$observer->_id]);
  722. return true;
  723. }
  724. /**
  725. * Informs each registered observer instance that a new message has been
  726. * logged.
  727. *
  728. * @param array $event A hash describing the log event.
  729. *
  730. * @access protected
  731. */
  732. function _announce($event)
  733. {
  734. foreach ($this->_listeners as $id => $listener)
  735. {
  736. if ($event['priority'] <= $this->_listeners[$id]->_priority)
  737. {
  738. $this->_listeners[$id]->notify($event);
  739. }
  740. }
  741. }
  742. /**
  743. * Indicates whether this is a composite class.
  744. *
  745. * @return boolean True if this is a composite class.
  746. *
  747. * @access public
  748. * @since Log 1.0
  749. */
  750. function isComposite()
  751. {
  752. return false;
  753. }
  754. /**
  755. * Sets this Log instance's identification string.
  756. *
  757. * @param string $ident The new identification string.
  758. *
  759. * @access public
  760. * @since Log 1.6.3
  761. */
  762. function setIdent($ident)
  763. {
  764. $this->_ident = $ident;
  765. }
  766. /**
  767. * Returns the current identification string.
  768. *
  769. * @return string The current Log instance's identification string.
  770. *
  771. * @access public
  772. * @since Log 1.6.3
  773. */
  774. function getIdent()
  775. {
  776. return $this->_ident;
  777. }
  778. }