-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-990111: Add easy logging improvements
- Loading branch information
1 parent
3ccdab3
commit 5bd6504
Showing
6 changed files
with
186 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2024 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
using System.Diagnostics; | ||
|
||
namespace Snowflake.Data.Log | ||
{ | ||
internal class EasyLoggerUtil | ||
{ | ||
internal static int AllPermissions = 777; | ||
|
||
internal static int AllUserPermissions = 700; | ||
|
||
internal static int OnlyUserHasPermissionToWrite = 644; | ||
|
||
internal static string CallBash(string command) | ||
{ | ||
using (Process process = new Process()) | ||
{ | ||
process.StartInfo.FileName = "/bin/bash"; | ||
process.StartInfo.Arguments = $"-c \"{command}\""; | ||
process.StartInfo.UseShellExecute = false; | ||
process.StartInfo.RedirectStandardOutput = true; | ||
process.Start(); | ||
return process.StandardOutput.ReadToEnd().Replace("\n", string.Empty); | ||
} | ||
} | ||
} | ||
} |