Skip to content

Commit

Permalink
Move masking secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-lf committed Dec 6, 2024
1 parent 7e8af5c commit d6090aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Snowflake.Data/Logger/SFLoggerImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public void Debug(string msg, Exception ex = null)
{
if (IsDebugEnabled())
{
msg = SecretDetector.MaskSecrets(msg).maskedText;
Log(LoggingEvent.DEBUG.ToString(), msg, ex);
}
}
Expand All @@ -136,7 +135,6 @@ public void Information(string msg, Exception ex = null)
{
if (IsInformationEnabled())
{
msg = SecretDetector.MaskSecrets(msg).maskedText;
Log(LoggingEvent.INFO.ToString(), msg, ex);
}
}
Expand All @@ -145,7 +143,6 @@ public void Warning(string msg, Exception ex = null)
{
if (IsWarningEnabled())
{
msg = SecretDetector.MaskSecrets(msg).maskedText;
Log(LoggingEvent.WARN.ToString(), msg, ex);
}
}
Expand All @@ -155,7 +152,6 @@ public void Error(string msg, Exception ex = null)
{
if (IsErrorEnabled())
{
msg = SecretDetector.MaskSecrets(msg).maskedText;
Log(LoggingEvent.ERROR.ToString(), msg, ex);
}
}
Expand All @@ -164,7 +160,6 @@ public void Fatal(string msg, Exception ex = null)
{
if (IsFatalEnabled())
{
msg = SecretDetector.MaskSecrets(msg).maskedText;
Log(LoggingEvent.FATAL.ToString(), msg, ex);
}
}
Expand Down
4 changes: 4 additions & 0 deletions Snowflake.Data/Logger/SFLoggerPair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,28 @@ internal static SFLoggerPair GetLoggerPair<T>()

internal void LogDebug(string message, Exception ex = null)
{
message = SecretDetector.MaskSecrets(message).maskedText;
s_snowflakeLogger.Debug(message, ex);
s_customLogger.LogDebug(FormatBrackets(message), ex);
}

internal void LogInformation(string message, Exception ex = null)
{
message = SecretDetector.MaskSecrets(message).maskedText;
s_snowflakeLogger.Information(message, ex);
s_customLogger.LogInformation(message, ex);
}

internal void LogWarning(string message, Exception ex = null)
{
message = SecretDetector.MaskSecrets(message).maskedText;
s_snowflakeLogger.Warning(message, ex);
s_customLogger.LogWarning(message, ex);
}

internal void LogError(string message, Exception ex = null)
{
message = SecretDetector.MaskSecrets(message).maskedText;
s_snowflakeLogger.Error(message, ex);
s_customLogger.LogError(message, ex);
}
Expand Down

0 comments on commit d6090aa

Please sign in to comment.