zoukankan      html  css  js  c++  java
  • 日志函数

        //参数1:类型,参数2:code(定位),其它参数:值
        public function L()
        {
            $file = dirname(__FILE__)."/../../../Apps/".MODULE_NAME."/Log/".CONTROLLER_NAME.".txt";        
            $var_arr = func_get_args();
            $content_arr = array();
            foreach($var_arr as $k=>$value){
                if(!$k){
                    $type = $value;
                    continue;
                }
                if(1==$k){
                    $code = $value;
                    continue;
                }
                $value = json_encode($value);        
                $content_arr[] = $value;
            }
            if(!isset($type) || !isset($code)) return;
            
            $content = implode(" - ", $content_arr);
            $error_content = "【".$type."({$code})】-".date('Y-m-d H:i:s').":".$content."
    ";
            if( ThinkStorage::has($file) ){
                $content =  $str.ThinkStorage::read($file);
            }
            return ThinkStorage::put($file,$error_content);
        }
        private function L(){
            $var_arr = func_get_args();
            $content_arr = array();
            foreach($var_arr as $k=>$value){
                if(!$k){
                    $type = $value;
                    continue;
                }
                if(1==$k){
                    $code = $value;
                    continue;
                }
                //if(is_array($value) || is_object($value)){
                    $value = json_encode($value);
                //}        
                $content_arr[] = $value;
            }
            if(!isset($type) || !isset($code)) return;
            
            $content = implode(" - ", $content_arr);
            $error_content = "【".$type."({$code})】-".date('Y-m-d H:i:s').":".$content."
    ";
            error_log($error_content, 3, $this->log);
        }
  • 相关阅读:
    移动web开发框架研究
    Android客户端缓存机制(文字缓存和多媒体文件缓存)
    edittext实现自动查询,刷新listview
    Android属性动画 nineoldandroids
    android 框架LoonAndroid,码农偷懒专用
    待看
    aidl
    国内外DNS服务器地址列表
    js 防止重复点击
    js 模块化
  • 原文地址:https://www.cnblogs.com/chy1000/p/4818689.html
Copyright © 2011-2022 走看看