Skip to content

Commit

Permalink
[DEV] logger: Allow static flushing
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrZierhoffer committed May 13, 2022
1 parent 78527f6 commit e16fbc2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Emulator/Main/Logging/Logger.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2010-2021 Antmicro
// Copyright (c) 2010-2022 Antmicro
// Copyright (c) 2011-2015 Realtime Embedded
//
// This file is licensed under the MIT License.
Expand Down Expand Up @@ -122,6 +122,15 @@ public static void LogAs(object o, LogLevel type, string message, params object[
}
}

public static void Flush()
{
var emulationManager = EmulationManager.Instance;
if(emulationManager != null)
{
((ActualLogger)emulationManager.CurrentEmulation.CurrentLogger).Flush();
}
}

// see a comment at the top
#if !TRACE_ENABLED
[Conditional("TRACE_ENABLED")]
Expand Down

0 comments on commit e16fbc2

Please sign in to comment.