Skip to content

Commit

Permalink
SNOW-990111: Add easy logging improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-lf committed Jan 15, 2024
1 parent e0dbec7 commit 7da9e4f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Snowflake.Data.Tests/UnitTests/Logger/EasyLoggerManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class EasyLoggerManagerTest
private const string WarnMessage = "Easy logging Warn message";
private const string ErrorMessage = "Easy logging Error message";
private const string FatalMessage = "Easy logging Fatal message";
private static readonly string s_logsDirectory = Path.GetTempPath();
private static readonly string s_logsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);

[ThreadStatic]
private static string t_directoryLogPath;
Expand Down Expand Up @@ -105,10 +105,14 @@ public void TestThatPermissionsFollowUmask()

// act
var umask = EasyLoggerUtil.AllPermissions - int.Parse(EasyLoggerUtil.CallBash("umask"));
var dirPermissions = EasyLoggerUtil.CallBash($"stat -c '%a' {t_directoryLogPath}");
int dirPermissions;
bool isParsed = int.TryParse(EasyLoggerUtil.CallBash($"stat -c '%a' {t_directoryLogPath}"), out dirPermissions);

// assert
Assert.IsTrue(umask >= int.Parse(dirPermissions));
if (isParsed)
{
Assert.IsTrue(umask >= dirPermissions);
}
}
}

Expand Down

0 comments on commit 7da9e4f

Please sign in to comment.