internal static void Log(this Exception ex, IDbConnectorLogger logger, bool isLoggingEnabled = true) { try { #if DEBUG Debug.WriteLine(ex.ToString()); #endif if (isLoggingEnabled) { if (logger != null) { logger.Log(ex); } else { OnError?.Invoke(ex); } } } catch (Exception e) { #if DEBUG Debug.WriteLine(e.ToString()); #endif } }