diff --git a/VectoCore/Models/SimulationComponent/SimulationComponentData.cs b/VectoCore/Models/SimulationComponent/SimulationComponentData.cs index a249e2e5671ad4f1cc5e8fe6bebc11ec64797401..331a960974be77390f4e9cee7661ad02afccf802 100644 --- a/VectoCore/Models/SimulationComponent/SimulationComponentData.cs +++ b/VectoCore/Models/SimulationComponent/SimulationComponentData.cs @@ -3,10 +3,18 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Common.Logging; namespace TUGraz.VectoCore.Models.SimulationComponent { public class SimulationComponentData { + protected ILog Logger; + + public SimulationComponentData() + { + Logger = LogManager.GetLogger(this.GetType()); + } + } } diff --git a/VectoCore/VectoCore.csproj b/VectoCore/VectoCore.csproj index e423382077accab1e0dc38e182284fde574bd960..49269220eb1f6d3a3e684b80264f6c63592a6a1c 100644 --- a/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore.csproj @@ -44,8 +44,9 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> </Reference> - <Reference Include="NLog"> - <HintPath>..\packages\NLog.3.1.0.0\lib\net45\NLog.dll</HintPath> + <Reference Include="NLog, Version=3.2.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\NLog.3.2.0.0\lib\net45\NLog.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> @@ -87,6 +88,7 @@ <Compile Include="Utils\DataRowExtensionMethods.cs" /> </ItemGroup> <ItemGroup> + <None Include="app.config" /> <None Include="packages.config" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> diff --git a/VectoCore/app.config b/VectoCore/app.config new file mode 100644 index 0000000000000000000000000000000000000000..204238d72820cc8e3bb43c964e2fe8a386cbd611 --- /dev/null +++ b/VectoCore/app.config @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <configSections> + <sectionGroup name="common"> + <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> + </sectionGroup> + <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" /> + </configSections> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.2.0.0" newVersion="3.2.0.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> + <common> + <logging> + <factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog31"> + <arg key="configType" value="INLINE"/> + </factoryAdapter> + </logging> + </common> + <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <targets> + <target xsi:type="Console" name="ConsoleLogger" error="true" /> + <target xsi:type="File" name="LogFile" filename="${basedir}/logs/log.txt" layout="${longdate} [${processid}@${machinename}] ${callsite} ${level:uppercase=true}: ${message}" /> + </targets> + <rules> + <logger name="*" minlevel="Info" writeTo="LogFile" /> + </rules> + </nlog> +</configuration> \ No newline at end of file diff --git a/VectoCore/packages.config b/VectoCore/packages.config index 8cb64e159edec02c4b6d19bf674981c8477c26d6..d4a3fcac5d0e232c1e87c07329653f01d5301fc5 100644 --- a/VectoCore/packages.config +++ b/VectoCore/packages.config @@ -4,5 +4,5 @@ <package id="Common.Logging.Core" version="3.0.0" targetFramework="net45" /> <package id="Common.Logging.NLog31" version="3.0.0" targetFramework="net45" /> <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" /> - <package id="NLog" version="3.1.0.0" targetFramework="net45" /> + <package id="NLog" version="3.2.0.0" targetFramework="net45" /> </packages> \ No newline at end of file diff --git a/VectoCoreTest/VectoCoreTest.csproj b/VectoCoreTest/VectoCoreTest.csproj index 6457e9a9934cd1e2d2479dd0bf9272ab4285ec64..96dd475a80d6bd6ebc506d19e7b447fef04468e6 100644 --- a/VectoCoreTest/VectoCoreTest.csproj +++ b/VectoCoreTest/VectoCoreTest.csproj @@ -35,6 +35,20 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="Common.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Common.Logging.3.0.0\lib\net40\Common.Logging.dll</HintPath> + </Reference> + <Reference Include="Common.Logging.Core"> + <HintPath>..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll</HintPath> + <Private>True</Private> + </Reference> + <Reference Include="Common.Logging.NLog31"> + <HintPath>..\packages\Common.Logging.NLog31.3.0.0\lib\net40\Common.Logging.NLog31.dll</HintPath> + </Reference> + <Reference Include="NLog"> + <HintPath>..\packages\NLog.3.2.0.0\lib\net45\NLog.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Design" /> @@ -71,24 +85,28 @@ <ItemGroup> <None Include="app.config" /> <None Include="default.runsettings" /> + <None Include="packages.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> - <None Include="TestData\EngineOnly\Test1\24t Coach.veng"> + <None Include="TestData\EngineOnly\EngineMaps\24t Coach.veng"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Include="TestData\EngineOnly\Test1\24t Coach.vfld"> + <None Include="TestData\EngineOnly\EngineMaps\24t Coach.vfld"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Include="TestData\EngineOnly\Test1\24t Coach.vmap"> + <None Include="TestData\EngineOnly\EngineMaps\24t Coach.vmap"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Include="TestData\EngineOnly\Test1\Coach Engine Only.vdri"> + <None Include="TestData\EngineOnly\Cycles\Coach Engine Only.vdri"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup> <ItemGroup> + <None Include="TestData\EngineOnly\ResultFiles\Test1_results.vmod" /> + <None Include="TestData\EngineOnly\ResultFiles\Test1_results.vsum" /> + <None Include="TestData\EngineOnly\ResultFiles\Test1_results.vsum.json" /> <None Include="TestData\EngineTests.csv"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> diff --git a/VectoCoreTest/app.config b/VectoCoreTest/app.config index 49cc43e1d8f54e541889767ccf34bebecdf5255f..d91dcf3c83cfadd501d684a13f218d337e1e6527 100644 --- a/VectoCoreTest/app.config +++ b/VectoCoreTest/app.config @@ -1,3 +1,33 @@ -<?xml version="1.0" encoding="utf-8" ?> +<?xml version="1.0" encoding="utf-8"?> <configuration> + <configSections> + <sectionGroup name="common"> + <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> + </sectionGroup> + <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" /> + </configSections> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.2.0.0" newVersion="3.2.0.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> + <common> + <logging> + <factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog31"> + <arg key="configType" value="INLINE" /> + </factoryAdapter> + </logging> + </common> + <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <targets> + <target xsi:type="Console" name="ConsoleLogger" error="true" /> + <target xsi:type="File" name="LogFile" filename="${basedir}/logs/log.txt" layout="${longdate} [${processid}@${machinename}] ${callsite} ${level:uppercase=true}: ${message}" /> + </targets> + <rules> + <logger name="*" minlevel="Info" writeTo="LogFile" /> + </rules> + </nlog> </configuration> \ No newline at end of file diff --git a/VectoCoreTest/packages.config b/VectoCoreTest/packages.config new file mode 100644 index 0000000000000000000000000000000000000000..13ccd21a7c065d08605db8562feb621b77d2ba85 --- /dev/null +++ b/VectoCoreTest/packages.config @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Common.Logging" version="3.0.0" targetFramework="net45" /> + <package id="Common.Logging.Core" version="3.0.0" targetFramework="net45" /> + <package id="Common.Logging.NLog31" version="3.0.0" targetFramework="net45" /> + <package id="NLog" version="3.2.0.0" targetFramework="net45" /> +</packages> \ No newline at end of file