Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit d3ea3050 authored by Harald Martini's avatar Harald Martini
Browse files

updated override logging

parent 8cfef1d9
No related branches found
No related tags found
No related merge requests found
......@@ -322,7 +322,11 @@ Public Class MainForm
' ReSharper disable once UnusedMember.Global -- used via Logging Framework!
Public Shared Sub LogMethod(level As String, message As String)
If VectoWorkerV3 Is Nothing Then
Debug.WriteLine("{0}, {1}", level, message)
Return
End If
If VectoWorkerV3.IsBusy AndAlso Not VectoWorkerV3.CancellationPending Then
If level = "Warn" Then
VectoWorkerV3.ReportProgress(100,
......
......@@ -10,6 +10,7 @@
</targets>
<rules>
<logger name="TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory" minlevel="Info" writeTo="LogFile" />
<logger name="TUGraz.VectoCore.Models.Declaration.Impl.LookupData" minLevel="Info" writeTo="LogFile"/>
<logger name="*" minlevel="Warn" writeTo="LogFile" />
<logger name="*" minlevel="Warn" writeTo="GUILogger" />
</rules>
......
......@@ -54,15 +54,14 @@ namespace TUGraz.VectoCore.Models.Declaration
#if USE_EXTERNAL_DECLARATION_DATA
protected bool _readFromFile = false;
private static bool _overrideFileDeleted = false;
#endif
[Conditional("USE_EXTERNAL_DECLARATION_DATA")]
protected void WarnReadFromFile()
{
if (_readFromFile) {
//Not displayed in simulation window (don't know why? Just write to file for now)
//var tmp = ResourceId?.Replace(DeclarationData.DeclarationDataResourcePrefix + ".", "") ?? "unknown resource";
//Log.Warn(string.Format("{0} overridden", tmp));
//Not displayed in simulation window(don't know why? Just write to file for now)
var tmp = ResourceId?.Replace(DeclarationData.DeclarationDataResourcePrefix + ".", "") ?? "unknown resource";
Log.Warn(string.Format("{0} overridden", tmp));
}
}
......@@ -93,7 +92,6 @@ namespace TUGraz.VectoCore.Models.Declaration
#if USE_EXTERNAL_DECLARATION_DATA
var tmp = resourceId.Replace(DeclarationData.DeclarationDataResourcePrefix + ".", "");
var parts = tmp.Split('.');
//one dir up
var fileName = Path.GetFullPath(Path.Combine(@"Declaration\Override", string.Join(".", parts[parts.Length-2], parts[parts.Length-1])));
Console.WriteLine(fileName);
......@@ -103,17 +101,7 @@ namespace TUGraz.VectoCore.Models.Declaration
}
_readFromFile = true;
var overrideFileName = "override.txt";
if (File.Exists(overrideFileName) && !_overrideFileDeleted) {
File.Delete(overrideFileName);
_overrideFileDeleted = true;
}
using (StreamWriter w = File.AppendText(overrideFileName))
{
w.WriteLine(string.Format("{0}: {1}", DateTime.Now, fileName));
w.Flush();
}
return VectoCSVFile.Read(fileName);
return VectoCSVFile.Read(fileName);
}
#endif
return VectoCSVFile.ReadStream(RessourceHelper.ReadStream(resourceId), source: resourceId);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment