Log.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\facade;
  12. use think\Facade;
  13. /**
  14. * @see \think\Log
  15. * @mixin \think\Log
  16. * @method \think\Log init(array $config = []) static 日志初始化
  17. * @method mixed getLog(string $type = '') static 获取日志信息
  18. * @method \think\Log record(mixed $msg, string $type = 'info', array $context = []) static 记录日志信息
  19. * @method \think\Log clear() static 清空日志信息
  20. * @method \think\Log key(string $key) static 当前日志记录的授权key
  21. * @method \think\Log close() static 关闭本次请求日志写入
  22. * @method bool check(array $config) static 检查日志写入权限
  23. * @method bool save() static 保存调试信息
  24. * @method void write(mixed $msg, string $type = 'info', bool $force = false) static 实时写入日志信息
  25. * @method void log(string $level,mixed $message, array $context = []) static 记录日志信息
  26. * @method void emergency(mixed $message, array $context = []) static 记录emergency信息
  27. * @method void alert(mixed $message, array $context = []) static 记录alert信息
  28. * @method void critical(mixed $message, array $context = []) static 记录critical信息
  29. * @method void error(mixed $message, array $context = []) static 记录error信息
  30. * @method void warning(mixed $message, array $context = []) static 记录warning信息
  31. * @method void notice(mixed $message, array $context = []) static 记录notice信息
  32. * @method void info(mixed $message, array $context = []) static 记录info信息
  33. * @method void debug(mixed $message, array $context = []) static 记录debug信息
  34. * @method void sql(mixed $message, array $context = []) static 记录sql信息
  35. */
  36. class Log extends Facade
  37. {
  38. /**
  39. * 获取当前Facade对应类名(或者已经绑定的容器对象标识)
  40. * @access protected
  41. * @return string
  42. */
  43. protected static function getFacadeClass()
  44. {
  45. return 'log';
  46. }
  47. }