Remove linebreaks from log file entires

This commit is contained in:
N00MKRAD
2020-12-10 15:37:42 +01:00
parent dd4043abe9
commit fde0d64a6a
3 changed files with 6 additions and 10 deletions

View File

@@ -251,7 +251,7 @@
<Compile Include="IO\Formats.cs" />
<Compile Include="IO\IOUtils.cs" />
<Compile Include="IO\Paths.cs" />
<Compile Include="Logger.cs" />
<Compile Include="IO\Logger.cs" />
<Compile Include="Magick\Converter.cs" />
<Compile Include="Magick\MagickDedupe.cs" />
<Compile Include="OS\NvApi.cs" />

View File

@@ -38,21 +38,21 @@ namespace Flowframes
LogToFile(s, false, filename);
}
public static void LogToFile(string s, bool noLineBreak, string filename)
public static void LogToFile(string logStr, bool noLineBreak, string filename)
{
if (string.IsNullOrWhiteSpace(filename))
filename = defaultLogName;
file = Path.Combine(Paths.GetLogPath(), filename);
logStr = logStr.Replace(Environment.NewLine, " | ");
string time = DT.Now.Month + "-" + DT.Now.Day + "-" + DT.Now.Year + " " + DT.Now.Hour + ":" + DT.Now.Minute + ":" + DT.Now.Second;
try
{
if (!noLineBreak)
File.AppendAllText(file, Environment.NewLine + time + ": " + s);
File.AppendAllText(file, Environment.NewLine + time + ": " + logStr);
else
File.AppendAllText(file, " " + s);
File.AppendAllText(file, " " + logStr);
}
catch
{

View File

@@ -23,10 +23,6 @@ namespace Flowframes
Application.Exit();
//new InstallerForm().ShowDialog();
}
else
{
}
}
@@ -43,7 +39,7 @@ namespace Flowframes
// if pkg is required and not installed, return false
if (pkg.friendlyName.ToLower().Contains("required") && !PkgUtils.IsInstalled(pkg))
{
Logger.Log($"Required packages \"{pkg.friendlyName}\" was not found!", true);
Logger.Log($"Required package \"{pkg.friendlyName}\" was not found!", true);
return false;
}
}