diff options
| author | Bond_009 <Bond.009@outlook.com> | 2019-04-24 15:25:22 +0200 |
|---|---|---|
| committer | Bond_009 <Bond.009@outlook.com> | 2019-04-24 15:25:22 +0200 |
| commit | a9337033c1d95d7238e9411abbc7255ef2456f35 (patch) | |
| tree | af8fa4b6655085114d9b3bb5a1dd648236c96fe1 /Emby.Server.Implementations/Data/SqliteItemRepository.cs | |
| parent | a0e61ee67f56a6f2735c3f3e8f97e3da794c0c1a (diff) | |
Fix query time logging
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs')
| -rw-r--r-- | Emby.Server.Implementations/Data/SqliteItemRepository.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 088a6694b..8841a9a50 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -2741,15 +2741,16 @@ namespace Emby.Server.Implementations.Data { var elapsed = (DateTime.UtcNow - startDate).TotalMilliseconds; - int slowThreshold = 100; - #if DEBUG - slowThreshold = 10; + const int SlowThreshold = 100; +#else + const int SlowThreshold = 10; #endif - if (elapsed >= slowThreshold) + if (elapsed >= SlowThreshold) { - Logger.LogWarning("{0} query time (slow): {1:g}. Query: {2}", + Logger.LogWarning( + "{Method} query time (slow): {ElapsedMs}ms. Query: {Query}", methodName, elapsed, commandText); |
