mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-19 19:29:15 +12:00
Fix N00BS
This commit is contained in:
parent
0c299729dd
commit
b3df338715
15 changed files with 71 additions and 81 deletions
|
@ -48,14 +48,17 @@ namespace HISP.Cli
|
|||
}
|
||||
public static void LogToFile(bool error, string type,string text)
|
||||
{
|
||||
sw.WriteLineAsync(text + sw.NewLine);
|
||||
sw.WriteLineAsync(DateTime.Now.ToString("MM-dd-YYYY HH:mm:dd") + ": [" + type + "] " + text + sw.NewLine);
|
||||
}
|
||||
public static void LogStdout(bool error, string type, string text)
|
||||
{
|
||||
if (type == "CRASH")
|
||||
LogToFile(error, type, text);
|
||||
|
||||
if (error)
|
||||
Console.Error.WriteAsync("[" + type + "] " + text + Console.Error.NewLine);
|
||||
Console.Error.WriteAsync(DateTime.Now.ToString("MM-dd-YYYY HH:mm:dd")+": [" + type + "] " + text + Console.Error.NewLine);
|
||||
else
|
||||
Console.Out.WriteAsync("[" + type + "] " + text + Console.Out.NewLine);
|
||||
Console.Out.WriteAsync(DateTime.Now.ToString("MM-dd-YYYY HH:mm:dd") + ": [" + type + "] " + text + Console.Out.NewLine);
|
||||
|
||||
}
|
||||
|
||||
|
@ -120,6 +123,10 @@ namespace HISP.Cli
|
|||
LogFile = HispLogVar;
|
||||
Logger.SetCallback(LogToFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogFile = Path.Combine(BaseDir, "crash.log");
|
||||
}
|
||||
|
||||
if (HispBaseDir != null)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue