Skip to content

Commit

Permalink
Removed static logger from the FileManager class.
Browse files Browse the repository at this point in the history
  • Loading branch information
xvitaly committed Sep 7, 2024
1 parent f2f547b commit cd174cb
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/corelib/FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ namespace srcrepair.core
/// </summary>
public static class FileManager
{
/// <summary>
/// Logger instance for FileManager class.
/// </summary>
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();

/// <summary>
/// Checks for non-ASCII characters in string.
/// </summary>
Expand All @@ -44,18 +39,14 @@ public static bool CheckNonASCII(string Path)
/// <param name="FileName">Full path to file.</param>
public static void CreateFile(string FileName)
{
try
{
// Generating full path to destination directory...
string Dir = Path.GetDirectoryName(FileName);
// Generating full path to the destination directory...
string DirName = Path.GetDirectoryName(FileName);

// Check if destination directory exists. If not - creating...
if (!Directory.Exists(Dir)) { Directory.CreateDirectory(Dir); }
// Check if the destination directory exists. If not - creating...
if (!Directory.Exists(DirName)) { Directory.CreateDirectory(DirName); }

// Creating a mew empty file...
using (File.Create(FileName)) { /* Nothing here. */ }
}
catch (Exception Ex) { Logger.Warn(Ex); }
// Creating a new empty file...
using (File.Create(FileName)) { /* Nothing here. */ }
}

/// <summary>
Expand Down

0 comments on commit cd174cb

Please sign in to comment.