Skip to content
This repository was archived by the owner on Jun 13, 2021. It is now read-only.

Commit cf13a90

Browse files
authored
Merge pull request #3 from Cape-Code/release
Release
2 parents 3c9dcf5 + 765024a commit cf13a90

40 files changed

+2446
-0
lines changed

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CapeCode.Logging", "CapeCode.Logging\CapeCode.Logging.csproj", "{104612F1-9478-48B8-9B33-CF86E7E3CFC3}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{104612F1-9478-48B8-9B33-CF86E7E3CFC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{104612F1-9478-48B8-9B33-CF86E7E3CFC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{104612F1-9478-48B8-9B33-CF86E7E3CFC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{104612F1-9478-48B8-9B33-CF86E7E3CFC3}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {56F94F22-4646-43C5-9D75-E901AD6CD801}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{104612F1-9478-48B8-9B33-CF86E7E3CFC3}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>CapeCode.Logging</RootNamespace>
11+
<AssemblyName>CapeCode.Logging</AssemblyName>
12+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="CapeCode.DependencyInjection, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
34+
<HintPath>..\packages\CapeCode.DependencyInjection.1.0.1\lib\net461\CapeCode.DependencyInjection.dll</HintPath>
35+
</Reference>
36+
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
37+
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
38+
</Reference>
39+
<Reference Include="Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
40+
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.dll</HintPath>
41+
</Reference>
42+
<Reference Include="Microsoft.Practices.Unity.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
43+
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.Configuration.dll</HintPath>
44+
</Reference>
45+
<Reference Include="Microsoft.Practices.Unity.RegistrationByConvention, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL">
46+
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll</HintPath>
47+
</Reference>
48+
<Reference Include="System" />
49+
<Reference Include="System.Configuration" />
50+
<Reference Include="System.Core" />
51+
<Reference Include="System.Runtime.Serialization" />
52+
<Reference Include="System.Security" />
53+
<Reference Include="System.ServiceModel" />
54+
<Reference Include="System.Web" />
55+
<Reference Include="System.Windows.Forms" />
56+
<Reference Include="System.Xml.Linq" />
57+
<Reference Include="System.Data.DataSetExtensions" />
58+
<Reference Include="Microsoft.CSharp" />
59+
<Reference Include="System.Data" />
60+
<Reference Include="System.Net.Http" />
61+
<Reference Include="System.Xml" />
62+
</ItemGroup>
63+
<ItemGroup>
64+
<Compile Include="Configuration\EMailLogWriterConfigurationSection.cs" />
65+
<Compile Include="Configuration\FileLogWriterConfigurationSection.cs" />
66+
<Compile Include="Configuration\LogWriterConfigurationSection.cs" />
67+
<Compile Include="Configuration\PoolingEMailLogWriterConfigurationSection.cs" />
68+
<Compile Include="ConsoleLogWriter.cs" />
69+
<Compile Include="DebugLogWriter.cs" />
70+
<Compile Include="EMailLogWriter.cs" />
71+
<Compile Include="Email\EmailSender.cs" />
72+
<Compile Include="Email\EmailSenderConfiguration.cs" />
73+
<Compile Include="Email\Interfaces\Attachment.cs" />
74+
<Compile Include="Email\Interfaces\Email.cs" />
75+
<Compile Include="Email\Interfaces\EmailSenderException.cs" />
76+
<Compile Include="Email\Interfaces\EncryptedEmail.cs" />
77+
<Compile Include="Email\Interfaces\IEmailSender.cs" />
78+
<Compile Include="Email\Interfaces\IEmailSenderConfiguration.cs" />
79+
<Compile Include="Email\Interfaces\PublicAnnouncementSystemEmail.cs" />
80+
<Compile Include="Email\Interfaces\SecureMailAddress.cs" />
81+
<Compile Include="Email\Interfaces\SystemEmail.cs" />
82+
<Compile Include="FileLogWriter.cs" />
83+
<Compile Include="FilteringLogWriter.cs" />
84+
<Compile Include="FormattingLogWriter.cs" />
85+
<Compile Include="Interfaces\ILogEvent.cs" />
86+
<Compile Include="Interfaces\ILogger.cs" />
87+
<Compile Include="Interfaces\ILogManager.cs" />
88+
<Compile Include="Interfaces\ILogWriter.cs" />
89+
<Compile Include="Interfaces\ILogWriterConfiguration.cs" />
90+
<Compile Include="Interfaces\LogLevel.cs" />
91+
<Compile Include="LogEvent.cs" />
92+
<Compile Include="Logger.cs" />
93+
<Compile Include="LogManager.cs" />
94+
<Compile Include="PoolingEMailLogWriter.cs" />
95+
<Compile Include="Properties\AssemblyInfo.cs" />
96+
<Compile Include="RollingXmlWriterTraceListener.cs" />
97+
<Compile Include="TraceLogWriter.cs" />
98+
<Compile Include="VisualStudioLogWriter.cs" />
99+
<Compile Include="WindowLogWriter.cs" />
100+
</ItemGroup>
101+
<ItemGroup>
102+
<None Include="packages.config" />
103+
</ItemGroup>
104+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
105+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Configuration;
3+
using CapeCode.Logging.Interfaces;
4+
5+
namespace CapeCode.Logging.Configuration {
6+
public class EMailLogWriterConfigurationSection : ConfigurationSection, ILogWriterConfiguration {
7+
8+
public Type LogWriterType { get { return typeof( EMailLogWriter ); } }
9+
10+
[ConfigurationProperty( "MinimumLogLevel", DefaultValue = "Error", IsKey = true, IsRequired = false )]
11+
public LogLevel MinimumLogLevel {
12+
get { return ( ( LogLevel ) ( base[ "MinimumLogLevel" ] ) ); }
13+
//get { return ( (LogLevel)Enum.Parse(typeof(LogLevel), ((string) base[ "MinimumLogLevel" ] ), true) ); }
14+
set { base[ "MinimumLogLevel" ] = value; }
15+
}
16+
17+
}
18+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Configuration;
3+
using CapeCode.Logging.Interfaces;
4+
5+
namespace CapeCode.Logging.Configuration {
6+
public class FileLogWriterConfigurationSection : ConfigurationSection, ILogWriterConfiguration {
7+
8+
public Type LogWriterType { get { return typeof( FileLogWriter ); } }
9+
10+
[ConfigurationProperty( "FileName", DefaultValue = "", IsKey = false, IsRequired = true )]
11+
public string FileName {
12+
get { return ( ( string ) ( base[ "FileName" ] ) ); }
13+
set { base[ "FileName" ] = value; }
14+
}
15+
16+
[ConfigurationProperty( "MinimumLogLevel", DefaultValue = "", IsKey = false, IsRequired = false )]
17+
public LogLevel MinimumLogLevel {
18+
get { return ( ( LogLevel ) ( base[ "LogWriterType" ] ) ); }
19+
//get { return ( (LogLevel)Enum.Parse(typeof(LogLevel), ((string) base[ "MinimumLogLevel" ] ), true) ); }
20+
set { base[ "MinimumLogLevel" ] = value; }
21+
}
22+
}
23+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
using System.Configuration;
3+
using CapeCode.Logging.Interfaces;
4+
5+
namespace CapeCode.Logging.Configuration {
6+
public class LogWriterConfigurationSection : ConfigurationSection, ILogWriterConfiguration {
7+
8+
public Type LogWriterType {
9+
get {
10+
if ( LogWriterTypeString != null ) {
11+
return Type.GetType( LogWriterTypeString );
12+
} else {
13+
return null;
14+
}
15+
}
16+
set {
17+
LogWriterTypeString = value.AssemblyQualifiedName;
18+
}
19+
}
20+
21+
[ConfigurationProperty( "LogWriterTypeString", DefaultValue = null, IsKey = false, IsRequired = true )]
22+
public string LogWriterTypeString {
23+
get {
24+
return ( string ) base[ "LogWriterTypeString" ];
25+
}
26+
set { base[ "LogWriterTypeString" ] = value; }
27+
}
28+
}
29+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Configuration;
3+
using CapeCode.Logging.Interfaces;
4+
5+
namespace CapeCode.Logging.Configuration {
6+
7+
public class PoolingEMailLogWriterConfigurationSection : ConfigurationSection, ILogWriterConfiguration {
8+
9+
public Type LogWriterType { get { return typeof( PoolingEMailLogWriter ); } }
10+
11+
[ConfigurationProperty( "MinimumLogLevel", DefaultValue = "Error", IsKey = true, IsRequired = false )]
12+
public LogLevel MinimumLogLevel {
13+
get { return ( ( LogLevel ) ( base[ "MinimumLogLevel" ] ) ); }
14+
set { base[ "MinimumLogLevel" ] = value; }
15+
}
16+
17+
[ConfigurationProperty( "InitialPoolingSeconds", DefaultValue = "30", IsKey = true, IsRequired = false )]
18+
public int InitialPoolingSeconds {
19+
get { return ( ( int ) ( base[ "InitialPoolingSeconds" ] ) ); }
20+
set { base[ "InitialPoolingSeconds" ] = value; }
21+
}
22+
23+
[ConfigurationProperty( "IncrementPoolingSeconds", DefaultValue = "60", IsKey = true, IsRequired = false )]
24+
public int IncrementPoolingSeconds {
25+
get { return ( ( int ) ( base[ "IncrementPoolingSeconds" ] ) ); }
26+
set { base[ "IncrementPoolingSeconds" ] = value; }
27+
}
28+
29+
}
30+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
using CapeCode.Logging.Interfaces;
3+
4+
namespace CapeCode.Logging {
5+
public class ConsoleLogWriter : FormattingLogWriter<string> {
6+
7+
public ConsoleLogWriter( Func<ILogEvent, string> logFormatter, Func<ILogEvent, bool> logFilter )
8+
: base( logFormatter, logFilter ) {
9+
}
10+
11+
public override void WriteFormattedToMedium( string message ) {
12+
try {
13+
Console.WriteLine( message );
14+
} catch ( System.ObjectDisposedException ) {
15+
// A logger should not crash the system. This catches the exception which is been thrown when the console has already been closed.
16+
}
17+
}
18+
19+
public override void InitSettings( ILogWriterConfiguration configuration ) {
20+
}
21+
22+
#region IDisposable Members
23+
24+
public override void Dispose() {
25+
}
26+
27+
#endregion
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
using System.Diagnostics;
3+
using CapeCode.Logging.Interfaces;
4+
5+
namespace CapeCode.Logging {
6+
/// <summary>
7+
/// DebugLogWriter is intended for UnitTests to have live console output
8+
/// </summary>
9+
public class DebugLogWriter : FormattingLogWriter<string> {
10+
11+
public DebugLogWriter( Func<ILogEvent, string> logFormatter, Func<ILogEvent, bool> logFilter )
12+
: base( logFormatter, logFilter ) {
13+
}
14+
15+
public override void WriteFormattedToMedium( string message ) {
16+
Debug.WriteLine( message );
17+
}
18+
19+
public override void InitSettings( ILogWriterConfiguration configuration ) {
20+
}
21+
22+
#region IDisposable Members
23+
24+
public override void Dispose() {
25+
}
26+
27+
#endregion
28+
}
29+
}

0 commit comments

Comments
 (0)