/// <summary> /// Gets logs store. /// </summary> /// <param name="userConnection">User connection.</param> /// <returns>Logs store.</returns> public static TermCalculationLogStore GetStore(UserConnection userConnection) { if (IsLoggingEnabled(userConnection)) { TermCalculationLogStoreLoader loader = GetLoader(userConnection); return(loader?.Store); } return(null); }
/// <summary> /// Resets logs store. /// </summary> /// <param name="userConnection">User connection.</param> public static void ResetLogStore(UserConnection userConnection) { TermCalculationLogStoreLoader loader = GetLoader(userConnection); if (loader != null) { loader.Store = null; userConnection.SessionCache.WithLocalCaching() .SetOrRemoveValue(TermCalculationLogStore.CalculationLogEnabledCacheName, null); } }
/// <summary> /// Initializes logs store. /// </summary> /// <param name="userConnection">User connection.</param> /// <param name="store">Logs store.</param> public static void InitializeLogStore(UserConnection userConnection, TermCalculationLogStore store) { TermCalculationLogStoreLoader loader = GetLoader(userConnection); if (loader != null) { loader.Store = store; userConnection.SessionCache.WithLocalCaching() .SetOrRemoveValue(TermCalculationLogStore.CalculationLogEnabledCacheName, true); } }