PageRenderTime 51ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/script/lib/Log.php

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