Skip to content

Commit 0d3b0e0

Browse files
committed
Convert IsDebugEventLoggingEnabled property to readonly field
1 parent 6fcc003 commit 0d3b0e0

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

Orm/Xtensive.Orm/Orm/Domain.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System;
88
using System.Collections.Concurrent;
99
using System.Collections.Generic;
10-
using System.Diagnostics;
1110
using System.Threading;
1211
using System.Threading.Tasks;
1312
using JetBrains.Annotations;
@@ -22,9 +21,7 @@
2221
using Xtensive.Orm.Logging;
2322
using Xtensive.Orm.Model;
2423
using Xtensive.Orm.Providers;
25-
using Xtensive.Orm.Rse.Providers;
2624
using Xtensive.Orm.Upgrade;
27-
using Xtensive.Orm.Upgrade.Model;
2825
using Xtensive.Sql;
2926
using Xtensive.Sql.Info;
3027

@@ -45,7 +42,7 @@ public sealed class Domain : IDisposable, IHasExtensions
4542
private bool isDisposed;
4643
private Session singleConnectionOwner;
4744

48-
private bool IsDebugEventLoggingEnabled { get; set; }
45+
private readonly bool isDebugEventLoggingEnabled;
4946

5047
/// <summary>
5148
/// Occurs when new <see cref="Session"/> is open and activated.
@@ -242,7 +239,7 @@ internal Session OpenSession(SessionConfiguration configuration, bool activate)
242239
ArgumentValidator.EnsureArgumentNotNull(configuration, "configuration");
243240
configuration.Lock(true);
244241

245-
if (IsDebugEventLoggingEnabled) {
242+
if (isDebugEventLoggingEnabled) {
246243
OrmLog.Debug(Strings.LogOpeningSessionX, configuration);
247244
}
248245

@@ -383,7 +380,7 @@ internal async Task<Session> OpenSessionInternalAsync(SessionConfiguration confi
383380
ArgumentValidator.EnsureArgumentNotNull(configuration, "configuration");
384381
configuration.Lock(true);
385382

386-
if (IsDebugEventLoggingEnabled) {
383+
if (isDebugEventLoggingEnabled) {
387384
OrmLog.Debug(Strings.LogOpeningSessionX, configuration);
388385
}
389386

@@ -456,7 +453,7 @@ internal Domain(DomainConfiguration configuration, object upgradeContextCookie,
456453
UpgradeContextCookie = upgradeContextCookie;
457454
SingleConnection = singleConnection;
458455
StorageNodeManager = new StorageNodeManager(Handlers);
459-
IsDebugEventLoggingEnabled = OrmLog.IsLogged(LogLevel.Debug); // Just to cache this value
456+
isDebugEventLoggingEnabled = OrmLog.IsLogged(LogLevel.Debug); // Just to cache this value
460457
}
461458

462459
/// <inheritdoc/>
@@ -467,7 +464,7 @@ public void Dispose()
467464
return;
468465
isDisposed = true;
469466

470-
if (IsDebugEventLoggingEnabled) {
467+
if (isDebugEventLoggingEnabled) {
471468
OrmLog.Debug(Strings.LogDomainIsDisposing);
472469
}
473470

0 commit comments

Comments
 (0)