<?php namespace Meibuyu\Micro\Aspect; use Hyperf\Di\Annotation\Aspect; use Hyperf\Di\Aop\AbstractAspect; use Hyperf\Di\Aop\ProceedingJoinPoint; use Meibuyu\Micro\Annotation\LogTrace; use Meibuyu\Micro\Handler\LogTrace\LogTraceHandler; /** * @Aspect( * annotations={ * LogTrace::class * } * ) */ class LogTraceAspect extends AbstractAspect { /** * 优先级 * @var int */ public $priority = 999; public function process(ProceedingJoinPoint $proceedingJoinPoint) { LogTraceHandler::createLogTrace( $proceedingJoinPoint->className.'@'.$proceedingJoinPoint->methodName, $proceedingJoinPoint->getArguments() ); return $proceedingJoinPoint->process(); } }