默认常量有哪些

遵循PSR-3标准,SeasLog 共将日志分成8个级别

●SEASLOG_DEBUG "debug"

●SEASLOG_INFO "info"

●SEASLOG_NOTICE "notice"

●SEASLOG_WARNING "warning"

●SEASLOG_ERROR "error"

●SEASLOG_CRITICAL "critical"

●SEASLOG_ALERT "alert"

●SEASLOG_EMERGENCY "emergency"

都提供哪些方法

SeasLog 提供了这样一组函数,可以方便地获取与设置根目录、模块目录、快速写入与统计log。 相信从下述伪代码的注释中,您可以快速获取函数信息(有经验的coder,也可将下述代码保存成SeasLog.php导入你的IDE,code tips,你懂的),具体使用将紧接其后:

  1. <?php 
  2. /** 
  3.  * @author neeke@php.net 云智慧 
  4.  */ 
  5.  
  6. class SeasLog 
  7.     public function __construct() 
  8.     { 
  9.         #SeasLog init 
  10.     } 
  11.  
  12.     public function __destruct() 
  13.     { 
  14.         #SeasLog distroy 
  15.     } 
  16.  
  17.     /** 
  18.      * 设置basePath 
  19.      * @param $basePath 
  20.      * @return bool 
  21.      */ 
  22.     static public function setBasePath($basePath) 
  23.     { 
  24.         return TRUE; 
  25.     } 
  26.  
  27.     /** 
  28.      * 获取basePath 
  29.      * @return string 
  30.      */ 
  31.     static public function getBasePath() 
  32.     { 
  33.         return 'the base_path'; 
  34.     } 
  35.  
  36.     /** 
  37.      * 设置模块目录 
  38.      * @param $module 
  39.      * @return bool 
  40.      */ 
  41.     static public function setLogger($module) 
  42.     { 
  43.         return TRUE; 
  44.     } 
  45.  
  46.     /** 
  47.      * 获取最后一次设置的模块目录 
  48.      * @return string 
  49.      */ 
  50.     static public function getLastLogger() 
  51.     { 
  52.         return 'the lastLogger'; 
  53.     } 
  54.  
  55.     /** 
  56.      * 统计所有类型或单个类型)行数 
  57.      * @param string $level 
  58.      * @param string $log_path 
  59.      * @param null $key_word 
  60.      * @return array | long 
  61.      */ 
  62.     static public function analyzerCount($level = 'all',$log_path = '*',$key_word = NULL
  63.     { 
  64.         return array(); 
  65.     } 
  66.  
  67.     /** 
  68.      * 以数组形式,快速取出某类型log的各行详情 
  69.      * @param $level 
  70.      * @param string $log_path 
  71.      * @param null $key_word 
  72.      * @param int $start 
  73.      * @param int $limit 
  74.      * @return array 
  75.      */ 
  76.     static public function analyzerDetail($level = SEASLOG_INFO,$log_path = '*',$key_word = NULL, $start = 1,$limit = 20
  77.     { 
  78.         return array(); 
  79.     } 
  80.  
  81.     /** 
  82.      * 获得当前日志buffer中的内容 
  83.      * @return array 
  84.      */ 
  85.     static public function getBuffer() 
  86.     { 
  87.         return array(); 
  88.     } 
  89.  
  90.     /** 
  91.      * 记录debug日志 
  92.      * @param $message 
  93.      * @param array $content 
  94.      * @param string $module 
  95.      */ 
  96.     static public function debug($message,array $content = array(),$module = ''
  97.     { 
  98.         #$level = SEASLOG_DEBUG 
  99.     } 
  100.  
  101.     /** 
  102.      * 记录info日志 
  103.      * @param $message 
  104.      * @param array $content 
  105.      * @param string $module 
  106.      */ 
  107.     static public function info($message,array $content = array(),$module = ''
  108.     { 
  109.         #$level = SEASLOG_INFO 
  110.     } 
  111.  
  112.     /** 
  113.      * 记录notice日志 
  114.      * @param $message 
  115.      * @param array $content 
  116.      * @param string $module 
  117.      */ 
  118.     static public function notice($message,array $content = array(),$module = ''
  119.     { 
  120.         #$level = SEASLOG_NOTICE 
  121.     } 
  122.  
  123.     /** 
  124.      * 记录warning日志 
  125.      * @param $message 
  126.      * @param array $content 
  127.      * @param string $module 
  128.      */ 
  129.     static public function warning($message,array $content = array(),$module = ''
  130.     { 
  131.         #$level = SEASLOG_WARNING 
  132.     } 
  133.  
  134.     /** 
  135.      * 记录error日志 
  136.      * @param $message 
  137.      * @param array $content 
  138.      * @param string $module 
  139.      */ 
  140.     static public function error($message,array $content = array(),$module = ''
  141.     { 
  142.         #$level = SEASLOG_ERROR 
  143.     } 
  144.  
  145.     /** 
  146.      * 记录critical日志 
  147.      * @param $message 
  148.      * @param array $content 
  149.      * @param string $module 
  150.      */ 
  151.     static public function critical($message,array $content = array(),$module = ''
  152.     { 
  153.         #$level = SEASLOG_CRITICAL 
  154.     } 
  155.  
  156.     /** 
  157.      * 记录alert日志 
  158.      * @param $message 
  159.      * @param array $content 
  160.      * @param string $module 
  161.      */ 
  162.     static public function alert($message,array $content = array(),$module = ''
  163.     { 
  164.         #$level = SEASLOG_ALERT 
  165.     } 
  166.  
  167.     /** 
  168.      * 记录emergency日志 
  169.      * @param $message 
  170.      * @param array $content 
  171.      * @param string $module 
  172.      */ 
  173.     static public function emergency($message,array $content = array(),$module = ''
  174.     { 
  175.         #$level = SEASLOG_EMERGENCY 
  176.     } 
  177.  
  178.     /** 
  179.      * 通用日志方法 
  180.      * @param $level 
  181.      * @param $message 
  182.      * @param array $content 
  183.      * @param string $module 
  184.      */ 
  185.     static public function log($level,$message,array $content = array(),$module = ''
  186.     { 
  187.  
  188.     } 




相关内容