logger: Don't crash when not able to write to log
This commit is contained in:
parent
f308216bbc
commit
62bcad5563
|
@ -49,8 +49,14 @@ namespace Sparkles {
|
||||||
Console.WriteLine (line);
|
Console.WriteLine (line);
|
||||||
|
|
||||||
lock (log_writer_lock) {
|
lock (log_writer_lock) {
|
||||||
|
try {
|
||||||
log_writer.WriteLine (line);
|
log_writer.WriteLine (line);
|
||||||
log_writer.Flush ();
|
log_writer.Flush ();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
Console.WriteLine (string.Format ("Could not write to log {0}: {1} {2}",
|
||||||
|
(log_writer.BaseStream as FileStream).Name, e.Message, e.StackTrace));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue