Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 8 commits
  • 51 files changed
  • 0 commit comments
  • 1 contributor
Showing with 284 additions and 58 deletions.
  1. +9 −0 Makefile
  2. +16 −0 build.cmd
  3. +5 −0 {tools → src}/InstallNLogConfig/InstallNLogConfig.mono2.csproj
  4. +5 −0 {tools → src}/InstallNLogConfig/InstallNLogConfig.netfx20.csproj
  5. +5 −0 {tools → src}/InstallNLogConfig/InstallNLogConfig.netfx35.csproj
  6. +5 −0 {tools → src}/InstallNLogConfig/InstallNLogConfig.netfx40.csproj
  7. 0  {tools → src}/InstallNLogConfig/Program.cs
  8. +0 −1  {tools → src}/InstallNLogConfig/Properties/AssemblyInfo.cs
  9. +6 −1 src/NLog.Extended/NLog.Extended.mono2.csproj
  10. +5 −0 src/NLog.Extended/NLog.Extended.monodevelop.csproj
  11. +6 −1 src/NLog.Extended/NLog.Extended.netfx20.csproj
  12. +6 −1 src/NLog.Extended/NLog.Extended.netfx35.csproj
  13. +6 −1 src/NLog.Extended/NLog.Extended.netfx40.csproj
  14. +0 −1  src/NLog.Extended/Properties/AssemblyInfo.cs
  15. +1 −1  src/NLog.netfx20.sln
  16. +1 −1  src/NLog.netfx35.sln
  17. +1 −1  src/NLog.netfx40.sln
  18. +37 −13 src/NLog.proj
  19. +14 −1 src/NLog/LogEventInfo.cs
  20. +6 −1 src/NLog/NLog.mono2.csproj
  21. +6 −1 src/NLog/NLog.netcf20.csproj
  22. +7 −4 src/NLog/NLog.netcf35.csproj
  23. +6 −1 src/NLog/NLog.netfx20.csproj
  24. +6 −1 src/NLog/NLog.netfx35.csproj
  25. +6 −1 src/NLog/NLog.netfx40.csproj
  26. +6 −1 src/NLog/NLog.sl2.csproj
  27. +6 −1 src/NLog/NLog.sl3.csproj
  28. +6 −1 src/NLog/NLog.sl4.csproj
  29. +6 −1 src/NLog/NLog.wp7.csproj
  30. +6 −1 src/NLog/NLog.wp71.csproj
  31. +0 −1  src/NLog/Properties/AssemblyInfo.cs
  32. +19 −1 tests/NLog.UnitTests/LoggerTests.cs
  33. +20 −2 tests/NLog.UnitTests/SourceCodeTests.cs
  34. +1 −1  tests/NLog.UnitTests/Targets/NetworkTargetTests.cs
  35. +1 −1  tests/NLog.UnitTests/Targets/Wrappers/BufferingTargetWrapperTests.cs
  36. +47 −13 tools/DumpTestResultSummary/Program.cs
  37. +1 −2  {tests → tools}/SilverlightConsoleRunner/ConsoleRunner.cs
  38. 0  {tests → tools}/SilverlightConsoleRunner/MicroHttpServer.cs
  39. 0  {tests → tools}/SilverlightConsoleRunner/Program.cs
  40. 0  {tests → tools}/SilverlightConsoleRunner/Properties/AssemblyInfo.cs
  41. 0  {tests → tools}/SilverlightConsoleRunner/RunnerForm.Designer.cs
  42. 0  {tests → tools}/SilverlightConsoleRunner/RunnerForm.cs
  43. 0  {tests → tools}/SilverlightConsoleRunner/RunnerForm.resx
  44. 0  {tests → tools}/SilverlightConsoleRunner/Silverlight2.js
  45. 0  {tests → tools}/SilverlightConsoleRunner/Silverlight3.js
  46. 0  {tests → tools}/SilverlightConsoleRunner/Silverlight4.js
  47. 0  {tests → tools}/SilverlightConsoleRunner/SilverlightConsoleRunner.csproj
  48. 0  {tests → tools}/SilverlightConsoleRunner/SilverlightConsoleRunner.sln
  49. 0  {tests → tools}/SilverlightConsoleRunner/XapHost2.html
  50. 0  {tests → tools}/SilverlightConsoleRunner/XapHost3.html
  51. 0  {tests → tools}/SilverlightConsoleRunner/XapHost4.html
View
9 Makefile
@@ -55,6 +55,15 @@ mergeapitool:
builddocpagestool:
$(XBUILD) tools/BuildDocPages/BuildDocPages.csproj /p:Configuration=$(CONFIG)
+syncprojectitemstool:
+ $(XBUILD) tools/SyncProjectItems/SyncProjectItems.csproj /p:Configuration=$(CONFIG)
+
+syncprojectitems: syncprojectitemstool
+ (cd src/NLog && mono ../../build/bin/Tools/SyncProjectItems.exe ProjectFileInfo.xml)
+ (cd src/NLog.Extended && mono ../../build/bin/Tools/SyncProjectItems.exe ProjectFileInfo.xml)
+ (cd tests/NLog.UnitTests && mono ../../build/bin/Tools/SyncProjectItems.exe ProjectFileInfo.xml)
+ (cd tests/SampleExtensions && mono ../../build/bin/Tools/SyncProjectItems.exe ProjectFileInfo.xml)
+
dumpapi: dumpapitool mergeapitool buildnlog
(cd $(OUTPUT_DIR) && mono ../../Tools/DumpApiXml.exe -comments NLog.xml -assembly NLog.dll -assembly NLog.Extended.dll -ref $(MONO_LIB_DIR) -output API/NLog.api)
(mono build/bin/Tools/MergeApiXml.exe "build/bin/$(CONFIG)")
View
16 build.cmd
@@ -201,6 +201,20 @@ if (%1)==(label) (
goto next
)
+if (%1)==(ccnetlabel) (
+ set MSBUILD_ARGUMENTS=%MSBUILD_ARGUMENTS% /p:CCNetLabel=%2
+ shift
+ shift
+ goto next
+)
+
+if (%1)==(buildpath) (
+ set MSBUILD_ARGUMENTS=%MSBUILD_ARGUMENTS% /p:BaseOutputDirectory=%2
+ shift
+ shift
+ goto next
+)
+
if (%1)==(websitedir) (
set MSBUILD_ARGUMENTS=%MSBUILD_ARGUMENTS% /p:WebsiteDir=%2
shift
@@ -266,6 +280,8 @@ echo xsd NLog.xsd Intellisense files
echo installer Installer
echo tools Tools
echo label {suffix} Define build label (defaults to 'PrivateBuild')
+echo ccnetlabel {label} Override CCNetLabel
+echo buildpath {dir} Set build directory.
exit /b 1
:build
View
5 ...NLogConfig/InstallNLogConfig.mono2.csproj → ...NLogConfig/InstallNLogConfig.mono2.csproj
@@ -49,4 +49,9 @@
</ProjectReference>
</ItemGroup>
<Import Project="..\..\src\Mono.targets" />
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
</Project>
View
5 ...ogConfig/InstallNLogConfig.netfx20.csproj → ...ogConfig/InstallNLogConfig.netfx20.csproj
@@ -59,4 +59,9 @@
<Target Name="AfterBuild">
</Target>
-->
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
</Project>
View
5 ...ogConfig/InstallNLogConfig.netfx35.csproj → ...ogConfig/InstallNLogConfig.netfx35.csproj
@@ -101,4 +101,9 @@
<Target Name="AfterBuild">
</Target>
-->
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
</Project>
View
5 ...ogConfig/InstallNLogConfig.netfx40.csproj → ...ogConfig/InstallNLogConfig.netfx40.csproj
@@ -63,4 +63,9 @@
<Target Name="AfterBuild">
</Target>
-->
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
</Project>
View
0  tools/InstallNLogConfig/Program.cs → src/InstallNLogConfig/Program.cs
File renamed without changes
View
1  ...tallNLogConfig/Properties/AssemblyInfo.cs → ...tallNLogConfig/Properties/AssemblyInfo.cs
@@ -63,7 +63,6 @@
[assembly: AssemblyDescription("NLog configuration installer")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("NLog")]
-[assembly: AssemblyProduct("NLog - Advanced .NET Logging")]
[assembly: AssemblyCopyright("Copyright (c) 2004-2010 by Jaroslaw Kowalski")]
[assembly: AssemblyCulture("")]
View
7 src/NLog.Extended/NLog.Extended.mono2.csproj
@@ -81,4 +81,9 @@
</ProjectReference>
</ItemGroup>
<Import Project="..\Mono.targets" />
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
5 src/NLog.Extended/NLog.Extended.monodevelop.csproj
@@ -83,4 +83,9 @@
<Name>NLog.monodevelop</Name>
</ProjectReference>
</ItemGroup>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
</Project>
View
7 src/NLog.Extended/NLog.Extended.netfx20.csproj
@@ -79,4 +79,9 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog.Extended/NLog.Extended.netfx35.csproj
@@ -88,4 +88,9 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog.Extended/NLog.Extended.netfx40.csproj
@@ -91,4 +91,9 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
1  src/NLog.Extended/Properties/AssemblyInfo.cs
@@ -53,7 +53,6 @@
[assembly: AssemblyDescription("NLog")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("NLog")]
-[assembly: AssemblyProduct("NLog - Advanced .NET Logging")]
[assembly: AssemblyCopyright("Copyright (c) 2004-2010 by Jaroslaw Kowalski")]
[assembly: AssemblyCulture("")]
View
2  src/NLog.netfx20.sln
@@ -12,7 +12,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.netfx20", ".
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netfx20", "..\tests\SampleExtensions\SampleExtensions.netfx20.csproj", "{1653EE05-2720-4A85-BF14-74C4593787B1}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx20", "..\tools\InstallNLogConfig\InstallNLogConfig.netfx20.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E5DA599EAA}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx20", "InstallNLogConfig\InstallNLogConfig.netfx20.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E5DA599EAA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Extended.netfx20", "NLog.Extended\NLog.Extended.netfx20.csproj", "{F801A1F9-1024-4446-BF9E-A923137340B8}"
EndProject
View
2  src/NLog.netfx35.sln
@@ -16,7 +16,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.BinaryCompatTests.netf
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netfx35", "..\tests\SampleExtensions\SampleExtensions.netfx35.csproj", "{A8CA32F1-BD4C-4A99-B307-99A93DB64B9F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx35", "..\tools\InstallNLogConfig\InstallNLogConfig.netfx35.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E4DA59AEAA}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx35", "InstallNLogConfig\InstallNLogConfig.netfx35.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E4DA59AEAA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Extended.netfx35", "NLog.Extended\NLog.Extended.netfx35.csproj", "{F801A1F9-1024-4446-BF9E-A923137340B8}"
EndProject
View
2  src/NLog.netfx40.sln
@@ -12,7 +12,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.UnitTests.netfx40", ".
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleExtensions.netfx40", "..\tests\SampleExtensions\SampleExtensions.netfx40.csproj", "{FE067913-E9A8-41F0-89FA-C1136F8FB6A8}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx40", "..\tools\InstallNLogConfig\InstallNLogConfig.netfx40.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E4DA599EAA}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallNLogConfig.netfx40", "InstallNLogConfig\InstallNLogConfig.netfx40.csproj", "{0CF95BE4-0546-4CE9-AB49-B9E4DA599EAA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Extended.netfx40", "NLog.Extended\NLog.Extended.netfx40.csproj", "{A961A1F9-1024-4446-BF9E-A923137340B8}"
EndProject
View
50 src/NLog.proj
@@ -2,13 +2,18 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
+ <MajorMinorVersion>2.0</MajorMinorVersion>
+ <BuildLabel Condition=" '$(BuildLabel)'=='' ">PrivateBuild</BuildLabel>
+ <BuildLabel Condition=" '$(CCNetLabel)'!='' ">$(CCNetLabel)</BuildLabel>
+ <BuildVersion>2.0.0.0</BuildVersion>
+ <BuildProductName>NLog v$(MajorMinorVersion) ($(BuildLabel))</BuildProductName>
+ </PropertyGroup>
+
+ <PropertyGroup>
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
<BaseOutputDirectory>$(MSBuildProjectDirectory)\..\build\</BaseOutputDirectory>
<ProjectTarget Condition="'$(ProjectTarget)'==''">Build</ProjectTarget>
<FrameworksPath>$(MSBuildProjectDirectory)\Frameworks</FrameworksPath>
- <BuildLabel>PrivateBuild</BuildLabel>
- <BuildLabel Condition=" '$(CCNetLabel)'!='' ">$(CCNetLabel)</BuildLabel>
- <BuildVersion>0.0.0.0</BuildVersion>
<BuildAllFrameworks>true</BuildAllFrameworks>
<BuildAllFrameworks Condition="'$(BuildMono2)' == 'true'">false</BuildAllFrameworks>
<BuildAllFrameworks Condition="'$(BuildSL2)' == 'true'">false</BuildAllFrameworks>
@@ -22,8 +27,7 @@
<BuildAllFrameworks Condition="'$(BuildNetCF20)' == 'true'">false</BuildAllFrameworks>
<BuildAllFrameworks Condition="'$(BuildNetCF35)' == 'true'">false</BuildAllFrameworks>
<ToolsDir>$(MSBuildProjectDirectory)\..\build\bin\Tools</ToolsDir>
- <SLTestRunner>$(MSBuildProjectDirectory)\..\build\bin\Tools\SilverlightConsoleRunner.exe</SLTestRunner>
- <DumpTestResultSummary>$(ToolsDir)\DumpTestResultSummary.exe</DumpTestResultSummary>
+ <SLTestRunner>$(BaseOutputDirectory)\bin\Tools\SilverlightConsoleRunner.exe</SLTestRunner>
<DeployNetCF>..\tools\DeployNetCF.exe</DeployNetCF>
<DumpApiXml>$(ToolsDir)\DumpApiXml.exe</DumpApiXml>
<MergeApiXml>$(ToolsDir)\MergeApiXml.exe</MergeApiXml>
@@ -39,6 +43,7 @@
<ConfigurationSuffix Condition="'$(Configuration)' == 'Debug'">-debug</ConfigurationSuffix>
<WebsiteDir Condition="'$(WebsiteDir)' == ''">$(BaseOutputDirectory)\bin\$(Configuration)\Website</WebsiteDir>
<LastTestRunSummary>$(BaseOutputDirectory)\bin\LastTestRunSummary.cmd</LastTestRunSummary>
+ <BuildInfoFile>$(BaseOutputDirectory)\obj\BuildInfo.cs</BuildInfoFile>
</PropertyGroup>
<!-- detect location of various SDKs and tools-->
@@ -189,26 +194,43 @@
</Target>
<Target Name="Build">
+ <PropertyGroup>
+ <BuildInfoFileContent>
+// automatically generated
+[assembly: System.Reflection.AssemblyProduct("$(BuildProductName)")]
+</BuildInfoFileContent>
+ </PropertyGroup>
+
+ <MakeDir Directories="$(BaseOutputDirectory)\obj" />
+
+ <ReadLinesFromFile File="$(BuildInfoFile)" Condition="Exists('$(BuildInfoFile)')">
+ <Output TaskParameter="Lines" ItemName="CurrentBuildInfoFileContent" />
+ </ReadLinesFromFile>
+
+ <WriteLinesToFile File="$(BuildInfoFile)"
+ Lines='$(BuildInfoFileContent)'
+ Overwrite="true"
+ Condition="'$(BuildInfoFileContent)' != '@(CurrentBuildInfoFileContent)' " />
<MSBuild Projects="NLog\NLog%(TargetFramework.ProjectFileSuffix).csproj"
Targets="Build"
- Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory)"
+ Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory);BuildInfoFile=$(BuildInfoFile)"
ToolsVersion="%(TargetFramework.ToolsVersion)"
ContinueOnError="$(BuildAllFrameworks)"
StopOnFirstFailure="false" />
<MSBuild Projects="NLog.Extended\NLog.Extended%(TargetFramework.ProjectFileSuffix).csproj"
Targets="Build"
- Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory)"
+ Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory);BuildInfoFile=$(BuildInfoFile)"
ToolsVersion="%(TargetFramework.ToolsVersion)"
ContinueOnError="$(BuildAllFrameworks)"
StopOnFirstFailure="false"
Condition="Exists('NLog.Extended\NLog.Extended%(TargetFramework.ProjectFileSuffix).csproj')" />
- <MSBuild Projects="..\tools\InstallNLogConfig\InstallNLogConfig%(TargetFramework.ProjectFileSuffix).csproj"
+ <MSBuild Projects="InstallNLogConfig\InstallNLogConfig%(TargetFramework.ProjectFileSuffix).csproj"
Targets="Build"
- Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory)"
+ Properties="$(StyleCopProperties);%(TargetFramework.Properties);BaseOutputDirectory=$(BaseOutputDirectory);BuildInfoFile=$(BuildInfoFile)"
ToolsVersion="%(TargetFramework.ToolsVersion)"
ContinueOnError="$(BuildAllFrameworks)"
StopOnFirstFailure="false"
- Condition="Exists('..\tools\InstallNLogConfig\InstallNLogConfig%(TargetFramework.ProjectFileSuffix).csproj')" />
+ Condition="Exists('InstallNLogConfig\InstallNLogConfig%(TargetFramework.ProjectFileSuffix).csproj')" />
<CallTarget Targets="BuildNLogC" />
</Target>
@@ -339,11 +361,13 @@
</Target>
<Target Name="WP7Test">
+ <Exec Command="TaskKill /f /im XDE.exe 2&gt; nul" IgnoreExitCode="true" />
<Exec Command='"$(SLTestRunner)" NLog.UnitTests.xap WP7 -guid 3cf9fab9-588c-49c8-8a45-ef071442304f -icon ApplicationIcon.png'
WorkingDirectory="$(BaseOutputDirectory)\bin\$(Configuration)\Silverlight for Windows Phone 7" IgnoreExitCode="true" />
</Target>
<Target Name="WP71Test">
+ <Exec Command="TaskKill /f /im XDE.exe 2&gt; nul" IgnoreExitCode="true" />
<Exec Command='"$(SLTestRunner)" NLog.UnitTests.xap WP71 -guid 3cf9fab9-588c-49c8-8a45-ef071442304f -icon ApplicationIcon.png'
WorkingDirectory="$(BaseOutputDirectory)\bin\$(Configuration)\Silverlight for Windows Phone 7.1" IgnoreExitCode="true" />
</Target>
@@ -367,7 +391,7 @@
<WriteLinesToFile File="$(LastTestRunSummary)" Lines='echo ---------------------' />
<WriteLinesToFile File="$(LastTestRunSummary)" Lines='echo Test run summary:' />
<WriteLinesToFile File="$(LastTestRunSummary)" Lines='echo ---------------------' />
- <WriteLinesToFile File="$(LastTestRunSummary)" Lines='"$(DumpTestResultSummary)" "%(TargetFramework.Identity)" "%~dp0$(Configuration)\%(TargetFramework.Identity)\TestResults.trx" %*' />
+ <WriteLinesToFile File="$(LastTestRunSummary)" Lines='%~dp0Tools\DumpTestResultSummary.exe all %~dp0$(Configuration) %*' />
</Target>
<Target Name="BuildMergedDocumentation">
@@ -426,7 +450,7 @@
</Target>
<Target Name="BuildSLTestRunner">
- <MSBuild Projects="..\tests\SilverlightConsoleRunner\SilverlightConsoleRunner.csproj" />
+ <MSBuild Projects="..\tools\SilverlightConsoleRunner\SilverlightConsoleRunner.csproj" />
</Target>
<Target Name="BuildTestResultSummaryTool">
@@ -535,7 +559,7 @@
<ProjectsToCleanup Include="..\tests\NLog.UnitTests.Web" />
<ProjectsToCleanup Include="..\tests\NLog.VBTest" />
<ProjectsToCleanup Include="..\tests\NLogC.Tests" />
- <ProjectsToCleanup Include="..\tests\SilverlightConsoleRunner" />
+ <ProjectsToCleanup Include="..\tools\SilverlightConsoleRunner" />
<ProjectsToCleanup Include="..\tools\MakeNLogXSD" />
<ProjectsToCleanup Include="..\tools\DeployNetCF" />
<ProjectsToCleanup Include="..\tools\DumpTestResultSummary" />
View
15 src/NLog/LogEventInfo.cs
@@ -431,7 +431,20 @@ private void CalcFormattedMessage()
}
else
{
- this.formattedMessage = string.Format(this.FormatProvider ?? CultureInfo.CurrentCulture, this.Message, this.Parameters);
+ try
+ {
+ this.formattedMessage = string.Format(this.FormatProvider ?? CultureInfo.CurrentCulture, this.Message, this.Parameters);
+ }
+ catch (Exception exception)
+ {
+ this.formattedMessage = this.Message;
+ if (exception.MustBeRethrown())
+ {
+ throw;
+ }
+
+ InternalLogger.Warn("Error when formatting a message: {0}", exception);
+ }
}
}
View
7 src/NLog/NLog.mono2.csproj
@@ -369,4 +369,9 @@
<CodeAnalysisDictionary Include="CustomDictionary.xml" />
</ItemGroup>
<Import Project="..\Mono.targets" />
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog/NLog.netcf20.csproj
@@ -382,4 +382,9 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
11 src/NLog/NLog.netcf35.csproj
@@ -294,9 +294,7 @@
<Compile Include="LogReceiverService\LogReceiverServiceConfig.cs" />
<Compile Include="LogReceiverService\NLogEvent.cs" />
<Compile Include="LogReceiverService\NLogEvents.cs" />
- <Compile Include="LogReceiverService\SoapLogReceiverClient.cs">
- <SubType>Component</SubType>
- </Compile>
+ <Compile Include="LogReceiverService\SoapLogReceiverClient.cs" />
<Compile Include="LogReceiverService\StringCollection.cs" />
<Compile Include="LogReceiverService\WcfLogReceiverClient.cs" />
<Compile Include="MappedDiagnosticsContext.cs" />
@@ -386,4 +384,9 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog/NLog.netfx20.csproj
@@ -366,4 +366,9 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(StyleCopTargetsFile)" Condition="'$(StyleCopTargetsFile)' != ''" />
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog/NLog.netfx35.csproj
@@ -368,4 +368,9 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(StyleCopTargetsFile)" Condition="'$(StyleCopTargetsFile)' != ''" />
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog/NLog.netfx40.csproj
@@ -372,4 +372,9 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(StyleCopTargetsFile)" Condition="Exists('$(StyleCopTargetsFile)')" />
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog/NLog.sl2.csproj
@@ -374,4 +374,9 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog/NLog.sl3.csproj
@@ -374,4 +374,9 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog/NLog.sl4.csproj
@@ -375,4 +375,9 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog/NLog.wp7.csproj
@@ -376,4 +376,9 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
+</Project>
View
7 src/NLog/NLog.wp71.csproj
@@ -369,6 +369,11 @@
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
<ProjectExtensions />
+ <Target Name="BeforeBuild">
+ <ItemGroup Condition="Exists('$(BuildInfoFile)')">
+ <Compile Include="$(BuildInfoFile)" />
+ </ItemGroup>
+ </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
@@ -376,4 +381,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project>
View
1  src/NLog/Properties/AssemblyInfo.cs
@@ -67,7 +67,6 @@
[assembly: AssemblyDescription("NLog")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("NLog")]
-[assembly: AssemblyProduct("NLog - Advanced .NET Logging")]
[assembly: AssemblyCopyright("Copyright (c) 2004-2010 by Jaroslaw Kowalski")]
[assembly: AssemblyCulture("")]
View
20 tests/NLog.UnitTests/LoggerTests.cs
@@ -1181,10 +1181,28 @@ public void LogTest()
}
}
+ [Test]
+ public void StringFormatWillNotCauseExceptions()
+ {
+ LogManager.Configuration = CreateConfigurationFromString(@"
+ <nlog throwExceptions='true'>
+ <targets><target name='debug' type='Debug' layout='${message}' /></targets>
+ <rules>
+ <logger name='*' minLevel='Info' writeTo='debug' />
+ </rules>
+ </nlog>");
+
+ Logger l = LogManager.GetLogger("StringFormatWillNotCauseExceptions");
+
+ // invalid format string
+ l.Info("aaaa {0");
+ AssertDebugLastMessage("debug", "aaaa {0");
+ }
+
public override string ToString()
{
return "object-to-string";
}
}
-}
+}
View
22 tests/NLog.UnitTests/SourceCodeTests.cs
@@ -84,7 +84,7 @@ public class SourceCodeTests
public void Initialize()
{
this.sourceCodeDirectory = Directory.GetCurrentDirectory();
- while (true)
+ while (this.sourceCodeDirectory != null)
{
this.licenseFile = Path.Combine(sourceCodeDirectory, "LICENSE.txt");
if (File.Exists(licenseFile))
@@ -95,12 +95,20 @@ public void Initialize()
this.sourceCodeDirectory = Path.GetDirectoryName(this.sourceCodeDirectory);
}
- this.licenseLines = File.ReadAllLines(this.licenseFile);
+ if (this.sourceCodeDirectory != null)
+ {
+ this.licenseLines = File.ReadAllLines(this.licenseFile);
+ }
}
[Test]
public void VerifyFileHeaders()
{
+ if (this.sourceCodeDirectory == null)
+ {
+ return;
+ }
+
int failedFiles = 0;
foreach (string dir in directoriesToVerify)
@@ -129,6 +137,11 @@ public void VerifyFileHeaders()
[Test]
public void VerifyProjectsInSync()
{
+ if (this.sourceCodeDirectory == null)
+ {
+ return;
+ }
+
int failures = 0;
var filesToCompile = new List<string>();
@@ -231,6 +244,11 @@ private static void GetAllFilesToCompileInDirectory(List<string> output, string
[Test]
public void VerifyNamespacesAndClassNames()
{
+ if (this.sourceCodeDirectory == null)
+ {
+ return;
+ }
+
int failedFiles = 0;
foreach (string dir in directoriesToVerify)
View
2  tests/NLog.UnitTests/Targets/NetworkTargetTests.cs
@@ -31,7 +31,7 @@
// THE POSSIBILITY OF SUCH DAMAGE.
//
-#if !WINDOWS_PHONE
+#if !WINDOWS_PHONE_7
namespace NLog.UnitTests.Targets
{
View
2  tests/NLog.UnitTests/Targets/Wrappers/BufferingTargetWrapperTests.cs
@@ -207,7 +207,7 @@ public void BufferingTargetWrapperSyncWithTimedFlushTest()
Assert.AreEqual(0, myTarget.WriteCount);
// sleep 2 seconds, this will trigger the timer and flush all events
- Thread.Sleep(2000);
+ Thread.Sleep(4000);
Assert.AreEqual(9, hitCount);
Assert.AreEqual(1, myTarget.BufferedWriteCount);
Assert.AreEqual(9, myTarget.BufferedTotalEvents);
View
60 tools/DumpTestResultSummary/Program.cs
@@ -52,15 +52,8 @@ static int Main(string[] args)
return 1;
}
+ string label = args[0];
string trxFileName = args[1];
- if (!File.Exists(trxFileName))
- {
- Console.Write(args[0].PadRight(35));
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("TRX file not found!");
- return 0;
- }
-
if (args.Length >= 3)
{
if (!Enum.TryParse(args[2], true, out mode))
@@ -70,11 +63,14 @@ static int Main(string[] args)
}
}
- XElement element = XElement.Load(trxFileName);
- var analyzer = new MSTestResultsFileAnalyzer(element.Name.Namespace);
- analyzer.Label = args[0];
- analyzer.Mode = mode;
- analyzer.DumpSummary(element);
+ if (label == "all")
+ {
+ ProcessDirectory(trxFileName, mode);
+ }
+ else
+ {
+ ProcessSingleTrxFile(trxFileName, label, mode);
+ }
return 0;
}
@@ -90,6 +86,44 @@ static int Main(string[] args)
}
}
+ private static void ProcessDirectory(string parentDirectory, AnalysisMode mode)
+ {
+ foreach (string subDir in Directory.GetDirectories(parentDirectory))
+ {
+ if (Directory.GetFiles(subDir, "*.UnitTests.dll").Length > 0)
+ {
+ string trxFile = Path.Combine(subDir, "TestResults.trx");
+ ProcessSingleTrxFile(trxFile, Path.GetFileName(subDir), mode);
+ }
+ }
+ }
+
+ private static void ProcessSingleTrxFile(string trxFileName, string label, AnalysisMode mode)
+ {
+ var oldColor = Console.ForegroundColor;
+ try
+ {
+ if (!File.Exists(trxFileName))
+ {
+ Console.Write(label.PadRight(35));
+ Console.ForegroundColor = ConsoleColor.Red;
+ Console.WriteLine("TRX file not found!");
+ }
+ else
+ {
+ XElement element = XElement.Load(trxFileName);
+ var analyzer = new MSTestResultsFileAnalyzer(element.Name.Namespace);
+ analyzer.Label = label;
+ analyzer.Mode = mode;
+ analyzer.DumpSummary(element);
+ }
+ }
+ finally
+ {
+ Console.ForegroundColor = oldColor;
+ }
+ }
+
private static void Usage()
{
Console.WriteLine("Usage: DumpTestResultSummary label filename.trx [summary|detailed]");
View
3  ...SilverlightConsoleRunner/ConsoleRunner.cs → ...SilverlightConsoleRunner/ConsoleRunner.cs
@@ -115,8 +115,7 @@ public void Run()
private void ResetTimer()
{
- // 90 second timeout
- this.timer.Change(90000, Timeout.Infinite);
+ this.timer.Change(180000, Timeout.Infinite);
}
private void OnTestMethodCompleted(HttpListenerContext context)
View
0  ...lverlightConsoleRunner/MicroHttpServer.cs → ...lverlightConsoleRunner/MicroHttpServer.cs
File renamed without changes
View
0  tests/SilverlightConsoleRunner/Program.cs → tools/SilverlightConsoleRunner/Program.cs
File renamed without changes
View
0  ...tConsoleRunner/Properties/AssemblyInfo.cs → ...tConsoleRunner/Properties/AssemblyInfo.cs
File renamed without changes
View
0  ...lightConsoleRunner/RunnerForm.Designer.cs → ...lightConsoleRunner/RunnerForm.Designer.cs
File renamed without changes
View
0  tests/SilverlightConsoleRunner/RunnerForm.cs → tools/SilverlightConsoleRunner/RunnerForm.cs
File renamed without changes
View
0  .../SilverlightConsoleRunner/RunnerForm.resx → .../SilverlightConsoleRunner/RunnerForm.resx
File renamed without changes
View
0  .../SilverlightConsoleRunner/Silverlight2.js → .../SilverlightConsoleRunner/Silverlight2.js
File renamed without changes
View
0  .../SilverlightConsoleRunner/Silverlight3.js → .../SilverlightConsoleRunner/Silverlight3.js
File renamed without changes
View
0  .../SilverlightConsoleRunner/Silverlight4.js → .../SilverlightConsoleRunner/Silverlight4.js
File renamed without changes
View
0  ...oleRunner/SilverlightConsoleRunner.csproj → ...oleRunner/SilverlightConsoleRunner.csproj
File renamed without changes
View
0  ...onsoleRunner/SilverlightConsoleRunner.sln → ...onsoleRunner/SilverlightConsoleRunner.sln
File renamed without changes
View
0  tests/SilverlightConsoleRunner/XapHost2.html → tools/SilverlightConsoleRunner/XapHost2.html
File renamed without changes
View
0  tests/SilverlightConsoleRunner/XapHost3.html → tools/SilverlightConsoleRunner/XapHost3.html
File renamed without changes
View
0  tests/SilverlightConsoleRunner/XapHost4.html → tools/SilverlightConsoleRunner/XapHost4.html
File renamed without changes

No commit comments for this range

Something went wrong with that request. Please try again.