Source for file Ethna_Plugin_Logwriter.php
Documentation is available at Ethna_Plugin_Logwriter.php
// vim: foldmethod=marker
* Ethna_Plugin_Logwriter.php
* @author Masaki Fujimoto <fujimoto@php.net>
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
// {{{ Ethna_Plugin_Logwriter
* @author Masaki Fujimoto <fujimoto@php.net>
/** @var string ログアイデンティティ文字列 */
/** @var bool バックトレースが取得可能かどうか */
/** @var array ログレベル名テーブル */
var $level_name_table =
array(
LOG_WARNING =>
'WARNING',
* Ethna_Plugin_Logwriterクラスのコンストラクタ
* @param string $log_ident ログアイデンティティ文字列(プロセス名等)
* @param int $log_facility ログファシリティ
* @param string $log_file ログ出力先ファイル名(LOG_FILEオプションが指定されている場合のみ)
* @param int $log_option ログオプション(LOG_FILE,LOG_FUNCTION...)
* @param int $option ログオプション(LOG_FILE,LOG_FUNCTION...)
$this->ident =
$option['ident'];
$this->facility =
$option['facility'];
* @param int $level ログレベル(LOG_DEBUG, LOG_NOTICE...)
* @param string $message ログメッセージ(+引数)
function log($level, $message)
* @return string ログアイデンティティ文字列
* @param int $level ログレベル(LOG_DEBUG,LOG_NOTICE...)
* @return string ログレベル表示文字列(LOG_DEBUG→"DEBUG")
function _getLogLevelName($level)
if (isset
($this->level_name_table[$level]) ==
false) {
return $this->level_name_table[$level];
* ログ出力箇所の情報(関数名/ファイル名等)を取得する
* @return array ログ出力箇所の情報
$skip_method_list =
array(
array(null, 'raiseerror'),
array(null, 'handleerror'),
array('ethna_logger', null),
array('ethna_plugin_logwriter', null),
array('ethna_error', null),
array('ethna_apperror', null),
array('ethna_actionerror', null),
array('ethna_backend', 'log'),
array(null, 'ethna_error_handler'),
array(null, 'trigger_error'),
if ($this->have_backtrace ==
false) {
while ($i <
count($bt)) {
if (isset
($bt[$i]['class']) ==
false) {
if (isset
($bt[$i]['file']) ==
false) {
if (isset
($bt[$i]['line']) ==
false) {
foreach ($skip_method_list as $method) {
$class =
$function =
true;
if ($method[0] !=
null) {
$class =
preg_match("/^$method[0]/i", $bt[$i]['class']);
if ($method[1] !=
null) {
$function =
preg_match("/^$method[1]/i", $bt[$i]['function']);
if ($class &&
$function) {
$basedir =
$c->getBasedir();
$function =
sprintf("%s.%s", isset
($bt[$i]['class']) ?
$bt[$i]['class'] :
'global', $bt[$i]['function']);
return array('function' =>
$function, 'pos' =>
sprintf('%s:%s', $file, $line));
Documentation generated on Fri, 11 Nov 2011 04:00:35 +0900 by phpDocumentor 1.4.3