feat: 完善sql耗时Aop
This commit is contained in:
@@ -242,6 +242,11 @@ namespace Yi.Framework.SqlSugarCore
|
|||||||
/// <param name="pars"></param>
|
/// <param name="pars"></param>
|
||||||
protected virtual void OnLogExecuted(string sql, SugarParameter[] pars)
|
protected virtual void OnLogExecuted(string sql, SugarParameter[] pars)
|
||||||
{
|
{
|
||||||
|
if (Options.EnabledSqlLog)
|
||||||
|
{
|
||||||
|
var sqllog = $"=========Yi-SQL耗时{SqlSugarClient.Ado.SqlExecutionTime.TotalMilliseconds}毫秒=====";
|
||||||
|
Logger.CreateLogger<SqlSugarDbContext>().LogDebug(sqllog.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using SqlSugar;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using SqlSugar;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
using Yi.Framework.Rbac.SqlSugarCore;
|
using Yi.Framework.Rbac.SqlSugarCore;
|
||||||
|
using Yi.Framework.SqlSugarCore;
|
||||||
|
|
||||||
namespace Yi.Abp.SqlSugarCore
|
namespace Yi.Abp.SqlSugarCore
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user