diff --git a/logging/Log.cs b/logging/Log.cs index 25a95db..119bfec 100644 --- a/logging/Log.cs +++ b/logging/Log.cs @@ -31,7 +31,8 @@ static public class log [Flags] public enum Endpoints { - Invalid = 0, + None = 0, + File = 1 << 0, Console = 1 << 1, @@ -249,6 +250,7 @@ static public class log } } + static Endpoints s_endpoints = Endpoints.Console; static void startup( string filename, Endpoints endpoints ) { @@ -411,11 +413,17 @@ static public class log //Console.WriteLine( finalMsg ); //Console.Out.Write( finalMsg ); - s_writer.WriteLine( finalLine ); + if( (s_endpoints & Endpoints.File) == Endpoints.File ) + { + s_writer.WriteLine( finalLine ); + } - setConsoleColor( evt ); - Console.WriteLine( finalLine ); - Console.ResetColor(); + if( (s_endpoints & Endpoints.Console) == Endpoints.Console ) + { + setConsoleColor( evt ); + Console.WriteLine( finalLine ); + Console.ResetColor(); + } //Debug.WriteLine( finalLine ); @@ -424,9 +432,7 @@ static public class log foreach( Log_delegate cb in s_delegates ) { - { - cb( evt ); - } + cb( evt ); } } }