x) Update to 8
x) Respect logging types
This commit is contained in:
parent
5e025284f0
commit
2ebedc7a7d
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||
<RootNamespace>lib</RootNamespace>
|
||||
<AssemblyVersion>0.0.1.0</AssemblyVersion>
|
||||
<FileVersion>0.0.1.0</FileVersion>
|
||||
|
||||
@ -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 );
|
||||
|
||||
if( (s_endpoints & Endpoints.File) == Endpoints.File )
|
||||
{
|
||||
s_writer.WriteLine( finalLine );
|
||||
}
|
||||
|
||||
if( (s_endpoints & Endpoints.Console) == Endpoints.Console )
|
||||
{
|
||||
setConsoleColor( evt );
|
||||
Console.WriteLine( finalLine );
|
||||
Console.ResetColor();
|
||||
}
|
||||
|
||||
|
||||
//Debug.WriteLine( finalLine );
|
||||
@ -423,13 +431,11 @@ static public class log
|
||||
s_writer.Flush();
|
||||
|
||||
foreach( Log_delegate cb in s_delegates )
|
||||
{
|
||||
{
|
||||
cb( evt );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
Console.WriteLine( "EXCEPTION DURING LOGGING" );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user