Log.class.php 1013 Bytes
<?php
/**
 * 记录日志的操作类
 * 
 * @name Facade_Log
 * @package facade
 * @copyright yoho.inc
 * @version 5.0 (2014-2-14 10:06:15)
 * @author fei.hong <fei.hong@yoho.cn>
 */
class Facade_Log
{
    private static $_service = null;
    
    /**
     * 单例模式实例化服务层对象
     * 
     * @return object
     */
    private static function service()
    {
        if (null === self::$_service)
        {
            self::$_service = new Service_Log();
        }
        return self::$_service;
    }

    /**
     * 添加日志记录
     *
     * @param integer $key  应用的ID
     * @param string $interfaceName  接口名称
     * @param string $input  输入参数
     * @param string $output  输出参数
     * @return boolean (false:失败, true:成功)
     */
    public static function add($key, $interfaceName, $input, $output)
    {
        if ($key && $interfaceName)
        {
            self::service()->add($key, $interfaceName, $input, $output);
        }
    }

}