Skip to content
Browse files

Removed the log4net dependency and made the logging configurable.

- Separate project configs for building without log4net
- Logging functionality is factored into an ILog + ILogFactory interface
- New logger can be installed in the app.config or programmatically using the LogManager class
- See the *Adapter projects' Demo.config about including your favorite logger (log4net and NLog)
  • Loading branch information...
1 parent 3a7bfee commit 8673380ac3d2f5f46013c06ddf5fd26b2bb49a83 @enyim enyim committed
Showing with 18,395 additions and 524 deletions.
  1. 0 CHANGES
  2. +29 −0 CommonProperties.targets
  3. +3 −68 DemoApp/DemoApp.csproj
  4. +33 −0 Enyim.Caching.Log4NetAdapter/Demo.config
  5. +58 −0 Enyim.Caching.Log4NetAdapter/Enyim.Caching.Log4NetAdapter.csproj
  6. +40 −0 Enyim.Caching.Log4NetAdapter/Log4NetFactory.cs
  7. +238 −0 Enyim.Caching.Log4NetAdapter/Log4NetWrapper.cs
  8. +37 −0 Enyim.Caching.Log4NetAdapter/Properties/AssemblyInfo.cs
  9. +15 −0 Enyim.Caching.NLogAdapter/Demo.config
  10. +59 −0 Enyim.Caching.NLogAdapter/Enyim.Caching.NLogAdapter.csproj
  11. +27 −0 Enyim.Caching.NLogAdapter/NLogFactory.cs
  12. +218 −0 Enyim.Caching.NLogAdapter/NLogWrapper.cs
  13. +36 −0 Enyim.Caching.NLogAdapter/Properties/AssemblyInfo.cs
  14. +13 −1 Enyim.Caching.sln
  15. +21 −0 Enyim.Caching/Configuration/LoggerSection.cs
  16. +11 −77 Enyim.Caching/Enyim.Caching.csproj
  17. +77 −0 Enyim.Caching/Logging/ILog.cs
  18. +33 −0 Enyim.Caching/Logging/ILogFactory.cs
  19. +101 −0 Enyim.Caching/Logging/LogManager.cs
  20. +116 −0 Enyim.Caching/Logging/NullLog.cs
  21. +1 −1 Enyim.Caching/Memcached/DefaultServerPool.cs
  22. +2 −2 Enyim.Caching/Memcached/MemcachedNode.cs
  23. +2 −2 Enyim.Caching/Memcached/PooledSocket.cs
  24. +1 −1 Enyim.Caching/Memcached/Protocol/Binary/BinaryNode.cs
  25. +1 −2 Enyim.Caching/Memcached/Protocol/Binary/BinaryRequest.cs
  26. +1 −1 Enyim.Caching/Memcached/Protocol/Binary/BinaryResponse.cs
  27. +1 −1 Enyim.Caching/Memcached/Protocol/Binary/DeleteOperation.cs
  28. +1 −1 Enyim.Caching/Memcached/Protocol/Binary/GetOperation.cs
  29. +1 −1 Enyim.Caching/Memcached/Protocol/Binary/MultiGetOperation.cs
  30. +1 −1 Enyim.Caching/Memcached/Protocol/Binary/StatsOperation.cs
  31. +1 −1 Enyim.Caching/Memcached/Protocol/Binary/StoreOperation.cs
  32. +1 −1 Enyim.Caching/Memcached/Protocol/Operation.cs
  33. +1 −1 Enyim.Caching/Memcached/Protocol/Text/GetHelper.cs
  34. +1 −1 Enyim.Caching/Memcached/Protocol/Text/MultiGetOperation.cs
  35. +1 −1 Enyim.Caching/Memcached/Protocol/Text/StatsOperation.cs
  36. +1 −1 Enyim.Caching/Memcached/Protocol/Text/TextSocketHelper.cs
  37. +1 −1 Enyim.Caching/Memcached/ServerStats.cs
  38. +1 −1 Enyim.Caching/MemcachedClient.cs
  39. +1 −10 Enyim.Caching/Properties/AssemblyInfo.cs
  40. +1 −1 Membase/BucketConfigListener.cs
  41. +1 −1 Membase/ConfigHelper.cs
  42. +2 −69 Membase/Membase.csproj
  43. +1 −1 Membase/MembaseClient.cs
  44. +1 −1 Membase/MembasePool.cs
  45. +2 −2 Membase/MessageStreamListener.cs
  46. +0 −9 Membase/Properties/AssemblyInfo.cs
  47. +6 −6 Membase/VBucketAwareOperationFactory.cs
  48. +2 −0 MemcachedTest/MembaseClientTest.cs
  49. +3 −1 MemcachedTest/MemcachedClientTest.cs
  50. +7 −51 MemcachedTest/MemcachedTest.csproj
  51. +2 −0 TestApp/App.config
  52. +36 −31 TestApp/Program.cs
  53. +7 −72 TestApp/TestApp.csproj
  54. +46 −22 VersionInfo.targets
  55. BIN binaries/NLog2/NLog.Extended.dll
  56. BIN binaries/NLog2/NLog.Extended.pdb
  57. +432 −0 binaries/NLog2/NLog.Extended.xml
  58. BIN binaries/NLog2/NLog.dll
  59. +2,560 −0 binaries/NLog2/NLog.netfx35.xsd
  60. BIN binaries/NLog2/NLog.pdb
  61. +14,031 −0 binaries/NLog2/NLog.xml
  62. 0 binaries/{ → log4net}/log4net.dll
  63. 0 binaries/{ → log4net}/log4net.xml
  64. +0 −79 build-release.msbuild
  65. +1 −1 build.cmd
  66. +68 −0 build.ps1
View
0 CHANGES
No changes.
View
29 CommonProperties.targets
@@ -0,0 +1,29 @@
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DefineConstants>TRACE;DEBUG</DefineConstants>
+ <RunCodeAnalysis>false</RunCodeAnalysis>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;SIGN</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <RunCodeAnalysis>false</RunCodeAnalysis>
+ </PropertyGroup>
+ <!-- local sign key -->
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>..\localbuild.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+</Project>
View
71 DemoApp/DemoApp.csproj
@@ -10,57 +10,16 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DemoApp</RootNamespace>
<AssemblyName>DemoApp</AssemblyName>
- <SccProjectName>
- </SccProjectName>
- <SccLocalPath>
- </SccLocalPath>
- <SccAuxPath>
- </SccAuxPath>
- <SccProvider>
- </SccProvider>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>3.5</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
+ <Import Project="..\CommonProperties.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
- <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
@@ -85,29 +44,5 @@
<Name>Membase</Name>
</ProjectReference>
</ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- 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">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
</Project>
View
33 Enyim.Caching.Log4NetAdapter/Demo.config
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
+ <sectionGroup name="enyim.com">
+ <section name="log" type="Enyim.Caching.Configuration.LoggerSection, Enyim.Caching" />
+ <!-- ... -->
+ </sectionGroup>
+ </configSections>
+
+ <enyim.com>
+ <log factory="Enyim.Caching.Log4NetFactory, Enyim.Caching.Log4NetAdapter" />
+ <!-- ... -->
+ </enyim.com>
+
+ <!-- Basic log4net config. Don't forget to call log4net.Configuration.XmlConfigurator.Configurator() at the start of your app. -->
+ <log4net>
+ <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
+ <layout type="log4net.Layout.PatternLayout,log4net">
+ <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
+ </layout>
+ </appender>
+ <appender name="TraceAppender" type="log4net.Appender.TraceAppender">
+ <layout type="log4net.Layout.PatternLayout,log4net">
+ <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
+ </layout>
+ </appender>
+ <root>
+ <level value="Info" />
+ <appender-ref ref="TraceAppender" />
+ </root>
+ </log4net>
+</configuration>
View
58 Enyim.Caching.Log4NetAdapter/Enyim.Caching.Log4NetAdapter.csproj
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{9D3F12E6-6BDD-4DED-8B25-D877780640B4}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Enyim.Caching.Log4NetAdapter</RootNamespace>
+ <AssemblyName>Enyim.Caching.Log4NetAdapter</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <Import Project="..\CommonProperties.targets" />
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <NoWarn>1591</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <NoWarn>1591</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="log4net">
+ <HintPath>..\binaries\log4net\log4net.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Log4NetFactory.cs" />
+ <Compile Include="Log4NetWrapper.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Enyim.Caching\Enyim.Caching.csproj">
+ <Project>{D438C0B3-A168-40B8-BDDD-61F0939DFF35}</Project>
+ <Name>Enyim.Caching</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Demo.config">
+ <SubType>Designer</SubType>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <GitTagMatch>emc*</GitTagMatch>
+ </PropertyGroup>
+ <Import Project="..\VersionInfo.targets" />
+</Project>
View
40 Enyim.Caching.Log4NetAdapter/Log4NetFactory.cs
@@ -0,0 +1,40 @@
+using System;
+
+namespace Enyim.Caching
+{
+ /// <summary>
+ /// log4net log factory
+ /// </summary>
+ public class Log4NetFactory : ILogFactory
+ {
+ ILog ILogFactory.GetLogger(string name)
+ {
+ return new Log4NetWrapper(log4net.LogManager.GetLogger(name));
+ }
+
+ ILog ILogFactory.GetLogger(Type type)
+ {
+ return new Log4NetWrapper(log4net.LogManager.GetLogger(type));
+ }
+ }
+}
+
+#region [ License information ]
+/* ************************************************************
+ *
+ * Copyright (c) 2010 Attila Kiskó, enyim.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ************************************************************/
+#endregion
View
238 Enyim.Caching.Log4NetAdapter/Log4NetWrapper.cs
@@ -0,0 +1,238 @@
+using System;
+
+namespace Enyim.Caching
+{
+ internal class Log4NetWrapper : ILog
+ {
+ private log4net.ILog log;
+
+ public Log4NetWrapper(log4net.ILog log)
+ {
+ this.log = log;
+ }
+
+ #region [ ILog ]
+
+ bool ILog.IsDebugEnabled
+ {
+ get { return this.log.IsDebugEnabled; }
+ }
+
+ bool ILog.IsInfoEnabled
+ {
+ get { return this.log.IsInfoEnabled; }
+ }
+
+ bool ILog.IsWarnEnabled
+ {
+ get { return this.log.IsWarnEnabled; }
+ }
+
+ bool ILog.IsErrorEnabled
+ {
+ get { return this.log.IsErrorEnabled; }
+ }
+
+ bool ILog.IsFatalEnabled
+ {
+ get { return this.log.IsFatalEnabled; }
+ }
+
+ void ILog.Debug(object message)
+ {
+ this.log.Debug(message);
+ }
+
+ void ILog.Debug(object message, Exception exception)
+ {
+ this.log.Debug(message, exception);
+ }
+
+ void ILog.DebugFormat(string format, object arg0)
+ {
+ this.log.DebugFormat(format, arg0);
+ }
+
+ void ILog.DebugFormat(string format, object arg0, object arg1)
+ {
+ this.log.DebugFormat(format, arg0, arg1);
+ }
+
+ void ILog.DebugFormat(string format, object arg0, object arg1, object arg2)
+ {
+ this.log.DebugFormat(format, arg0, arg1, arg2);
+ }
+
+ void ILog.DebugFormat(string format, params object[] args)
+ {
+ this.log.DebugFormat(format, args);
+ }
+
+ void ILog.DebugFormat(IFormatProvider provider, string format, params object[] args)
+ {
+ this.log.DebugFormat(provider, format, args);
+ }
+
+ void ILog.Info(object message)
+ {
+ this.log.Info(message);
+ }
+
+ void ILog.Info(object message, Exception exception)
+ {
+ this.log.Info(message, exception);
+ }
+
+ void ILog.InfoFormat(string format, object arg0)
+ {
+ this.log.InfoFormat(format, arg0);
+ }
+
+ void ILog.InfoFormat(string format, object arg0, object arg1)
+ {
+ this.log.InfoFormat(format, arg0, arg1);
+ }
+
+ void ILog.InfoFormat(string format, object arg0, object arg1, object arg2)
+ {
+ this.log.InfoFormat(format, arg0, arg1, arg2);
+ }
+
+ void ILog.InfoFormat(string format, params object[] args)
+ {
+ this.log.InfoFormat(format, args);
+ }
+
+ void ILog.InfoFormat(IFormatProvider provider, string format, params object[] args)
+ {
+ this.log.InfoFormat(provider, format, args);
+ }
+
+ void ILog.Warn(object message)
+ {
+ this.log.Warn(message);
+ }
+
+ void ILog.Warn(object message, Exception exception)
+ {
+ this.log.Warn(message, exception);
+ }
+
+ void ILog.WarnFormat(string format, object arg0)
+ {
+ this.log.WarnFormat(format, arg0);
+ }
+
+ void ILog.WarnFormat(string format, object arg0, object arg1)
+ {
+ this.log.WarnFormat(format, arg0, arg1);
+ }
+
+ void ILog.WarnFormat(string format, object arg0, object arg1, object arg2)
+ {
+ this.log.WarnFormat(format, arg0, arg1, arg2);
+ }
+
+ void ILog.WarnFormat(string format, params object[] args)
+ {
+ this.log.WarnFormat(format, args);
+ }
+
+ void ILog.WarnFormat(IFormatProvider provider, string format, params object[] args)
+ {
+ this.log.WarnFormat(provider, format, args);
+ }
+
+ void ILog.Error(object message)
+ {
+ this.log.Error(message);
+ }
+
+ void ILog.Error(object message, Exception exception)
+ {
+ this.log.Error(message, exception);
+ }
+
+ void ILog.ErrorFormat(string format, object arg0)
+ {
+ this.log.ErrorFormat(format, arg0);
+ }
+
+ void ILog.ErrorFormat(string format, object arg0, object arg1)
+ {
+ this.log.ErrorFormat(format, arg0, arg1);
+ }
+
+ void ILog.ErrorFormat(string format, object arg0, object arg1, object arg2)
+ {
+ this.log.ErrorFormat(format, arg0, arg1, arg2);
+ }
+
+ void ILog.ErrorFormat(string format, params object[] args)
+ {
+ this.log.ErrorFormat(format, args);
+ }
+
+ void ILog.ErrorFormat(IFormatProvider provider, string format, params object[] args)
+ {
+ this.log.ErrorFormat(provider, format, args);
+ }
+
+ void ILog.Fatal(object message)
+ {
+ this.log.Fatal(message);
+ }
+
+ void ILog.Fatal(object message, Exception exception)
+ {
+ this.log.Fatal(message, exception);
+ }
+
+ void ILog.FatalFormat(string format, object arg0)
+ {
+ this.log.FatalFormat(format, arg0);
+ }
+
+ void ILog.FatalFormat(string format, object arg0, object arg1)
+ {
+ this.log.FatalFormat(format, arg0, arg1);
+ }
+
+ void ILog.FatalFormat(string format, object arg0, object arg1, object arg2)
+ {
+ this.log.FatalFormat(format, arg0, arg1, arg2);
+ }
+
+ void ILog.FatalFormat(string format, params object[] args)
+ {
+ this.log.FatalFormat(format, args);
+ }
+
+ void ILog.FatalFormat(IFormatProvider provider, string format, params object[] args)
+ {
+ this.log.FatalFormat(provider, format, args);
+ }
+
+ #endregion
+ }
+}
+
+#region [ License information ]
+/* ************************************************************
+ *
+ * Copyright (c) 2010 Attila Kiskó, enyim.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ************************************************************/
+#endregion
View
37 Enyim.Caching.Log4NetAdapter/Properties/AssemblyInfo.cs
@@ -0,0 +1,37 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyProduct("Enyim.Caching.Log4NetAdapter")]
+
+[assembly: AssemblyCompany("enyim.com")]
+[assembly: AssemblyCopyright("Copyright © enyim.com, Attila Kiskó 2007-2010")]
+
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("0b1d407e-1abf-4635-a4ec-4b5f2d3a2346")]
+
+#region [ License information ]
+/* ************************************************************
+ *
+ * Copyright (c) 2010 Attila Kiskó, enyim.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ************************************************************/
+#endregion
View
15 Enyim.Caching.NLogAdapter/Demo.config
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ <sectionGroup name="enyim.com">
+ <section name="log" type="Enyim.Caching.Configuration.LoggerSection, Enyim.Caching" />
+ <!-- ... -->
+ </sectionGroup>
+ </configSections>
+
+ <enyim.com>
+ <log factory="Enyim.Caching.NLogFactory, Enyim.Caching.NLogAdapter" />
+ <!-- ... -->
+ </enyim.com>
+
+</configuration>
View
59 Enyim.Caching.NLogAdapter/Enyim.Caching.NLogAdapter.csproj
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C96760B1-7CAD-4983-9FAD-EB00CD7A9FC6}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Enyim.Caching.NLogAdapter</RootNamespace>
+ <AssemblyName>Enyim.Caching.NLogAdapter</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <Import Project="..\CommonProperties.targets" />
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <NoWarn>1591</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <NoWarn>1591</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="NLog">
+ <HintPath>..\binaries\NLog2\NLog.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="NLogFactory.cs" />
+ <Compile Include="NLogWrapper.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Enyim.Caching\Enyim.Caching.csproj">
+ <Project>{D438C0B3-A168-40B8-BDDD-61F0939DFF35}</Project>
+ <Name>Enyim.Caching</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Demo.config">
+ <SubType>Designer</SubType>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <GitTagMatch>emc*</GitTagMatch>
+ </PropertyGroup>
+ <Import Project="..\VersionInfo.targets" />
+</Project>
View
27 Enyim.Caching.NLogAdapter/NLogFactory.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Enyim.Caching
+{
+ class Class1 : Enyim.Caching.ILogFactory
+ {
+ ILog ILogFactory.GetLogger(string name)
+ {
+ var log = NLog.LogManager.GetLogger(name);
+
+ return new NLogWrapper(log);
+ }
+
+ ILog ILogFactory.GetLogger(Type type)
+ {
+ var log = NLog.LogManager.GetLogger(type.FullName);
+
+ return new NLogWrapper(log);
+ }
+ }
+
+
+
+}
View
218 Enyim.Caching.NLogAdapter/NLogWrapper.cs
@@ -0,0 +1,218 @@
+using System;
+
+namespace Enyim.Caching
+{
+ internal class NLogWrapper : Enyim.Caching.ILog
+ {
+ private NLog.Logger log;
+
+ public NLogWrapper(NLog.Logger log)
+ {
+ this.log = log;
+ }
+
+ #region [ ILog ]
+
+ bool ILog.IsDebugEnabled
+ {
+ get { return this.log.IsDebugEnabled; }
+ }
+
+ bool ILog.IsInfoEnabled
+ {
+ get { return this.log.IsDebugEnabled; }
+ }
+
+ bool ILog.IsWarnEnabled
+ {
+ get { return this.log.IsWarnEnabled; }
+ }
+
+ bool ILog.IsErrorEnabled
+ {
+ get { return this.log.IsErrorEnabled; }
+ }
+
+ bool ILog.IsFatalEnabled
+ {
+ get { return this.log.IsFatalEnabled; }
+ }
+
+ void ILog.Debug(object message)
+ {
+ this.log.Debug(message);
+ }
+
+ void ILog.Debug(object message, Exception exception)
+ {
+ this.log.DebugException((message ?? String.Empty).ToString(), exception);
+ }
+
+ void ILog.DebugFormat(string format, object arg0)
+ {
+ this.log.Debug(format, arg0);
+ }
+
+ void ILog.DebugFormat(string format, object arg0, object arg1)
+ {
+ this.log.Debug(format, arg0, arg1);
+ }
+
+ void ILog.DebugFormat(string format, object arg0, object arg1, object arg2)
+ {
+ this.log.Debug(format, arg0, arg1, arg2);
+ }
+
+ void ILog.DebugFormat(string format, params object[] args)
+ {
+ this.log.Debug(format, args);
+ }
+
+ void ILog.DebugFormat(IFormatProvider provider, string format, params object[] args)
+ {
+ this.log.Debug(provider, format, args);
+ }
+
+ void ILog.Info(object message)
+ {
+ this.log.Info(message);
+ }
+
+ void ILog.Info(object message, Exception exception)
+ {
+ this.log.InfoException((message ?? String.Empty).ToString(), exception);
+ }
+
+ void ILog.InfoFormat(string format, object arg0)
+ {
+ this.log.Info(format, arg0);
+ }
+
+ void ILog.InfoFormat(string format, object arg0, object arg1)
+ {
+ this.log.Info(format, arg0, arg1);
+ }
+
+ void ILog.InfoFormat(string format, object arg0, object arg1, object arg2)
+ {
+ this.log.Info(format, arg0, arg1, arg2);
+ }
+
+ void ILog.InfoFormat(string format, params object[] args)
+ {
+ this.log.Info(format, args);
+ }
+
+ void ILog.InfoFormat(IFormatProvider provider, string format, params object[] args)
+ {
+ this.log.Info(provider, format, args);
+ }
+
+ void ILog.Warn(object message)
+ {
+ this.log.Warn(message);
+ }
+
+ void ILog.Warn(object message, Exception exception)
+ {
+ this.log.WarnException((message ?? String.Empty).ToString(), exception);
+ }
+
+ void ILog.WarnFormat(string format, object arg0)
+ {
+ this.log.Warn(format, arg0);
+ }
+
+ void ILog.WarnFormat(string format, object arg0, object arg1)
+ {
+ this.log.Warn(format, arg0, arg1);
+ }
+
+ void ILog.WarnFormat(string format, object arg0, object arg1, object arg2)
+ {
+ this.log.Warn(format, arg0, arg1, arg2);
+ }
+
+ void ILog.WarnFormat(string format, params object[] args)
+ {
+ this.log.Warn(format, args);
+ }
+
+ void ILog.WarnFormat(IFormatProvider provider, string format, params object[] args)
+ {
+ this.log.Warn(provider, format, args);
+ }
+
+ void ILog.Error(object message)
+ {
+ this.log.Error(message);
+ }
+
+ void ILog.Error(object message, Exception exception)
+ {
+ this.log.ErrorException((message ?? String.Empty).ToString(), exception);
+ }
+
+ void ILog.ErrorFormat(string format, object arg0)
+ {
+ this.log.Error(format, arg0);
+ }
+
+ void ILog.ErrorFormat(string format, object arg0, object arg1)
+ {
+ this.log.Error(format, arg0, arg1);
+ }
+
+ void ILog.ErrorFormat(string format, object arg0, object arg1, object arg2)
+ {
+ this.log.Error(format, arg0, arg1, arg2);
+ }
+
+ void ILog.ErrorFormat(string format, params object[] args)
+ {
+ this.log.Error(format, args);
+ }
+
+ void ILog.ErrorFormat(IFormatProvider provider, string format, params object[] args)
+ {
+ this.log.Error(provider, format, args);
+ }
+
+ void ILog.Fatal(object message)
+ {
+ this.log.Fatal(message);
+ }
+
+ void ILog.Fatal(object message, Exception exception)
+ {
+ this.log.FatalException((message ?? String.Empty).ToString(), exception);
+ }
+
+ void ILog.FatalFormat(string format, object arg0)
+ {
+ this.log.Fatal(format, arg0);
+ }
+
+ void ILog.FatalFormat(string format, object arg0, object arg1)
+ {
+ this.log.Fatal(format, arg0, arg1);
+ }
+
+ void ILog.FatalFormat(string format, object arg0, object arg1, object arg2)
+ {
+ this.log.Fatal(format, arg0, arg1, arg2);
+ }
+
+ void ILog.FatalFormat(string format, params object[] args)
+ {
+ this.log.Fatal(format, args);
+ }
+
+ void ILog.FatalFormat(IFormatProvider provider, string format, params object[] args)
+ {
+ this.log.Fatal(provider, format, args);
+ }
+
+ #endregion
+ }
+}
View
36 Enyim.Caching.NLogAdapter/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyProduct("Enyim.Caching.NLogAdapter")]
+[assembly: AssemblyCompany("enyim.com")]
+[assembly: AssemblyCopyright("Copyright © enyim.com, Attila Kiskó 2007-2010")]
+
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d54c6003-0688-45c0-9a16-99cc054066ad")]
+
+#region [ License information ]
+/* ************************************************************
+ *
+ * Copyright (c) 2010 Attila Kiskó, enyim.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ************************************************************/
+#endregion
View
14 Enyim.Caching.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{319FC4D5-5302-46B4-887A-65CC10157B64}"
ProjectSection(SolutionItems) = preProject
- footer.txt = footer.txt
+ CHANGES = CHANGES
LICENSE = LICENSE
README.mdown = README.mdown
EndProjectSection
@@ -18,6 +18,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Membase", "Membase\Membase.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{607B1927-A964-48B2-AEA3-6810D10A6831}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enyim.Caching.Log4NetAdapter", "Enyim.Caching.Log4NetAdapter\Enyim.Caching.Log4NetAdapter.csproj", "{9D3F12E6-6BDD-4DED-8B25-D877780640B4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enyim.Caching.NLogAdapter", "Enyim.Caching.NLogAdapter\Enyim.Caching.NLogAdapter.csproj", "{C96760B1-7CAD-4983-9FAD-EB00CD7A9FC6}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -44,6 +48,14 @@ Global
{607B1927-A964-48B2-AEA3-6810D10A6831}.Debug|Any CPU.Build.0 = Debug|Any CPU
{607B1927-A964-48B2-AEA3-6810D10A6831}.Release|Any CPU.ActiveCfg = Release|Any CPU
{607B1927-A964-48B2-AEA3-6810D10A6831}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9D3F12E6-6BDD-4DED-8B25-D877780640B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9D3F12E6-6BDD-4DED-8B25-D877780640B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9D3F12E6-6BDD-4DED-8B25-D877780640B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9D3F12E6-6BDD-4DED-8B25-D877780640B4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C96760B1-7CAD-4983-9FAD-EB00CD7A9FC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C96760B1-7CAD-4983-9FAD-EB00CD7A9FC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C96760B1-7CAD-4983-9FAD-EB00CD7A9FC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C96760B1-7CAD-4983-9FAD-EB00CD7A9FC6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
21 Enyim.Caching/Configuration/LoggerSection.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Configuration;
+using Enyim.Caching.Configuration;
+using System.ComponentModel;
+
+namespace Enyim.Caching.Configuration
+{
+ public class LoggerSection : ConfigurationSection
+ {
+ [ConfigurationProperty("factory", IsRequired = true)]
+ [InterfaceValidator(typeof(ILogFactory)), TypeConverter(typeof(TypeNameConverter))]
+ public Type LogFactory
+ {
+ get { return (Type)base["factory"]; }
+ set { base["factory"] = value; }
+ }
+ }
+}
View
88 Enyim.Caching/Enyim.Caching.csproj
@@ -11,66 +11,18 @@
<RootNamespace>Enyim.Caching</RootNamespace>
<AssemblyName>Enyim.Caching</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>3.5</OldToolsVersion>
- <UpgradeBackupLocation />
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
+ <Import Project="..\CommonProperties.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <RunCodeAnalysis>false</RunCodeAnalysis>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <CodeAnalysisRules>
- </CodeAnalysisRules>
- <CodeAnalysisRuleSet>Migrated rules for Enyim.Caching.ruleset</CodeAnalysisRuleSet>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE;SIGN</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <DocumentationFile>bin\Release\Enyim.Caching.XML</DocumentationFile>
- <RunCodeAnalysis>false</RunCodeAnalysis>
- <CodeAnalysisRules>
- </CodeAnalysisRules>
- <CodeAnalysisRuleSet>Migrated rules for Enyim.Caching (2).ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup>
- <SignAssembly>true</SignAssembly>
- </PropertyGroup>
- <PropertyGroup>
- <AssemblyOriginatorKeyFile>..\localbuild.snk</AssemblyOriginatorKeyFile>
+ <NoWarn>1591</NoWarn>
+ <DocumentationFile>bin\Release\Enyim.Caching.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\binaries\log4net.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Configuration.Install" />
@@ -88,12 +40,17 @@
</Reference>
</ItemGroup>
<ItemGroup>
+ <Compile Include="FastActivator.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Logging\LogManager.cs" />
<Compile Include="Configuration\AuthenticationConfiguration.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Configuration\AuthenticationElement.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Configuration\LoggerSection.cs" />
<Compile Include="Configuration\ConfigurationElementException.cs">
<SubType>Code</SubType>
</Compile>
@@ -147,9 +104,11 @@
<Compile Include="IUIntHashAlgorithm.cs" />
<Compile Include="HashCodeCombiner.cs" />
<Compile Include="InterlockedQueue.cs" />
- <Compile Include="FastActivator.cs" />
<Compile Include="IFastObjectFacory.cs" />
<Compile Include="FnvHash.cs" />
+ <Compile Include="Logging\NullLog.cs" />
+ <Compile Include="Logging\ILogFactory.cs" />
+ <Compile Include="Logging\ILog.cs" />
<Compile Include="MemcachedClient.cs" />
<Compile Include="Memcached\Authentication\PlainTextAuthenticator.cs">
<SubType>Code</SubType>
@@ -370,34 +329,9 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<GitTagMatch>emc*</GitTagMatch>
</PropertyGroup>
<Import Project="..\VersionInfo.targets" />
- <!-- 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">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
</Project>
View
77 Enyim.Caching/Logging/ILog.cs
@@ -0,0 +1,77 @@
+using System;
+
+namespace Enyim.Caching
+{
+ /// <summary>
+ /// The ILog interface is used by the client to log messages.
+ /// </summary>
+ /// <remarks>Use the <see cref="T:Enyim.Caching.LogManager" /> class to programmatically assign logger implementations.</remarks>
+ public interface ILog
+ {
+ bool IsDebugEnabled { get; }
+ bool IsInfoEnabled { get; }
+ bool IsWarnEnabled { get; }
+ bool IsErrorEnabled { get; }
+ bool IsFatalEnabled { get; }
+
+ void Debug(object message);
+ void Debug(object message, Exception exception);
+ void DebugFormat(string format, object arg0);
+ void DebugFormat(string format, object arg0, object arg1);
+ void DebugFormat(string format, object arg0, object arg1, object arg2);
+ void DebugFormat(string format, params object[] args);
+ void DebugFormat(IFormatProvider provider, string format, params object[] args);
+
+ void Info(object message);
+ void Info(object message, Exception exception);
+ void InfoFormat(string format, object arg0);
+ void InfoFormat(string format, object arg0, object arg1);
+ void InfoFormat(string format, object arg0, object arg1, object arg2);
+ void InfoFormat(string format, params object[] args);
+ void InfoFormat(IFormatProvider provider, string format, params object[] args);
+
+ void Warn(object message);
+ void Warn(object message, Exception exception);
+ void WarnFormat(string format, object arg0);
+ void WarnFormat(string format, object arg0, object arg1);
+ void WarnFormat(string format, object arg0, object arg1, object arg2);
+ void WarnFormat(string format, params object[] args);
+ void WarnFormat(IFormatProvider provider, string format, params object[] args);
+
+ void Error(object message);
+ void Error(object message, Exception exception);
+ void ErrorFormat(string format, object arg0);
+ void ErrorFormat(string format, object arg0, object arg1);
+ void ErrorFormat(string format, object arg0, object arg1, object arg2);
+ void ErrorFormat(string format, params object[] args);
+ void ErrorFormat(IFormatProvider provider, string format, params object[] args);
+
+ void Fatal(object message);
+ void Fatal(object message, Exception exception);
+ void FatalFormat(string format, object arg0);
+ void FatalFormat(string format, object arg0, object arg1);
+ void FatalFormat(string format, object arg0, object arg1, object arg2);
+ void FatalFormat(string format, params object[] args);
+ void FatalFormat(IFormatProvider provider, string format, params object[] args);
+ }
+}
+
+#region [ License information ]
+/* ************************************************************
+ *
+ * Copyright (c) 2010 Attila Kiskó, enyim.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ************************************************************/
+#endregion
View
33 Enyim.Caching/Logging/ILogFactory.cs
@@ -0,0 +1,33 @@
+using System;
+
+namespace Enyim.Caching
+{
+ /// <summary>
+ /// Implement this interface to instantiate your custom ILog implementation
+ /// </summary>
+ public interface ILogFactory
+ {
+ ILog GetLogger(string name);
+ ILog GetLogger(Type type);
+ }
+}
+
+#region [ License information ]
+/* ************************************************************
+ *
+ * Copyright (c) 2010 Attila Kiskó, enyim.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ************************************************************/
+#endregion
View
101 Enyim.Caching/Logging/LogManager.cs
@@ -0,0 +1,101 @@
+using System;
+using System.Configuration;
+
+namespace Enyim.Caching
+{
+ /// <summary>
+ /// Creates loggers based on the current configuration.
+ /// </summary>
+ /// <example>
+ ///
+ /// Config file:
+ ///
+ /// <configuration>
+ /// <configSections>
+ /// <sectionGroup name="enyim.com">
+ /// <section name="log" type="Enyim.Caching.EnyimLoggerSection, Enyim.Caching" />
+ /// </sectionGroup>
+ /// </configSections>
+ /// <enyim.com>
+ /// <log factory="Enyim.Caching.Log4NetLoggerFactory, Enyim.Caching" />
+ /// </enyim.com>
+ /// </configuration>
+ ///
+ /// Code:
+ ///
+ /// LogManager.AssignFactory(new Log4NetLogFactory());
+ ///
+ /// </example>
+ public static class LogManager
+ {
+ private static ILogFactory factory;
+
+ static LogManager()
+ {
+ var section = ConfigurationManager.GetSection("enyim.com/log") as Enyim.Caching.Configuration.LoggerSection;
+ ILogFactory f = null;
+
+ if (section != null && section.LogFactory != null)
+ {
+ f = Enyim.Reflection.FastActivator.Create(section.LogFactory) as ILogFactory;
+ }
+#if !log4net
+ // use an empty logger if nothing is specified in the app.config
+ LogManager.factory = f ?? (ILogFactory)new NullLoggerFactory();
+#else
+ // use the log4net logger logger if nothing is specified in the app.config
+ LogManager.factory = f ?? (ILogFactory)new Log4NetLogFactory();
+#endif
+ }
+
+ /// <summary>
+ /// Assigns a new logger factory programmatically.
+ /// </summary>
+ /// <param name="factory"></param>
+ public static void AssignFactory(ILogFactory factory)
+ {
+ if (factory == null) throw new ArgumentNullException("factory");
+ LogManager.factory = factory;
+ }
+
+ /// <summary>
+ /// Returns a new logger for the specified Type.
+ /// </summary>
+ /// <param name="type"></param>
+ /// <returns></returns>
+ public static ILog GetLogger(Type type)
+ {
+ return factory.GetLogger(type);
+ }
+
+ /// <summary>
+ /// Returns a logger with the specified name.
+ /// </summary>
+ /// <param name="name"></param>
+ /// <returns></returns>
+ public static ILog GetLogger(string name)
+ {
+ return factory.GetLogger(name);
+ }
+ }
+}
+
+#region [ License information ]
+/* ************************************************************
+ *
+ * Copyright (c) 2010 Attila Kiskó, enyim.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ************************************************************/
+#endregion
View
116 Enyim.Caching/Logging/NullLog.cs
@@ -0,0 +1,116 @@
+using System;
+
+namespace Enyim.Caching
+{
+ /// <summary>
+ /// Creates an empty logger. Used when no other factories are installed.
+ /// </summary>
+ public class NullLoggerFactory : ILogFactory
+ {
+ ILog ILogFactory.GetLogger(string name)
+ {
+ return NullLogger.Instance;
+ }
+
+ ILog ILogFactory.GetLogger(Type type)
+ {
+ return NullLogger.Instance;
+ }
+
+ #region [ NullLogger ]
+
+ private class NullLogger : ILog
+ {
+ internal static readonly ILog Instance = new NullLogger();
+
+ private NullLogger() { }
+
+ #region [ ILog ]
+
+ bool ILog.IsDebugEnabled
+ {
+ get { return false; }
+ }
+
+ bool ILog.IsInfoEnabled
+ {
+ get { return false; }
+ }
+
+ bool ILog.IsWarnEnabled
+ {
+ get { return false; }
+ }
+
+ bool ILog.IsErrorEnabled
+ {
+ get { return false; }
+ }
+
+ bool ILog.IsFatalEnabled
+ {
+ get { return false; }
+ }
+
+ void ILog.Debug(object message) { }
+ void ILog.Debug(object message, Exception exception) { }
+ void ILog.DebugFormat(string format, object arg0) { }
+ void ILog.DebugFormat(string format, object arg0, object arg1) { }
+ void ILog.DebugFormat(string format, object arg0, object arg1, object arg2) { }
+ void ILog.DebugFormat(string format, params object[] args) { }
+ void ILog.DebugFormat(IFormatProvider provider, string format, params object[] args) { }
+ void ILog.Info(object message) { }
+ void ILog.Info(object message, Exception exception) { }
+ void ILog.InfoFormat(string format, object arg0) { }
+ void ILog.InfoFormat(string format, object arg0, object arg1) { }
+ void ILog.InfoFormat(string format, object arg0, object arg1, object arg2) { }
+ void ILog.InfoFormat(string format, params object[] args) { }
+ void ILog.InfoFormat(IFormatProvider provider, string format, params object[] args) { }
+ void ILog.Warn(object message) { }
+ void ILog.Warn(object message, Exception exception) { }
+ void ILog.WarnFormat(string format, object arg0) { }
+ void ILog.WarnFormat(string format, object arg0, object arg1) { }
+ void ILog.WarnFormat(string format, object arg0, object arg1, object arg2) { }
+ void ILog.WarnFormat(string format, params object[] args) { }
+ void ILog.WarnFormat(IFormatProvider provider, string format, params object[] args) { }
+ void ILog.Error(object message) { }
+ void ILog.Error(object message, Exception exception) { }
+ void ILog.ErrorFormat(string format, object arg0) { }
+ void ILog.ErrorFormat(string format, object arg0, object arg1) { }
+ void ILog.ErrorFormat(string format, object arg0, object arg1, object arg2) { }
+ void ILog.ErrorFormat(string format, params object[] args) { }
+ void ILog.ErrorFormat(IFormatProvider provider, string format, params object[] args) { }
+ void ILog.Fatal(object message) { }
+ void ILog.Fatal(object message, Exception exception) { }
+ void ILog.FatalFormat(string format, object arg0) { }
+ void ILog.FatalFormat(string format, object arg0, object arg1) { }
+ void ILog.FatalFormat(string format, object arg0, object arg1, object arg2) { }
+ void ILog.FatalFormat(string format, params object[] args) { }
+ void ILog.FatalFormat(IFormatProvider provider, string format, params object[] args) { }
+
+ #endregion
+ }
+
+ #endregion
+ }
+}
+
+#region [ License information ]
+/* ************************************************************
+ *
+ * Copyright (c) 2010 Attila Kiskó, enyim.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ************************************************************/
+#endregion
View
2 Enyim.Caching/Memcached/DefaultServerPool.cs
@@ -10,7 +10,7 @@ namespace Enyim.Caching.Memcached
{
public class DefaultServerPool : IServerPool, IDisposable
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(DefaultServerPool));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(DefaultServerPool));
private IMemcachedNode[] allNodes;
View
4 Enyim.Caching/Memcached/MemcachedNode.cs
@@ -16,7 +16,7 @@ namespace Enyim.Caching.Memcached
[DebuggerDisplay("{{MemcachedNode [ Address: {EndPoint}, IsAlive = {IsAlive} ]}}")]
public class MemcachedNode : IMemcachedNode
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(MemcachedNode));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(MemcachedNode));
private static readonly object SyncRoot = new Object();
private bool isDisposed;
@@ -167,7 +167,7 @@ void IDisposable.Dispose()
#region [ InternalPoolImpl ]
private class InternalPoolImpl : IDisposable
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(InternalPoolImpl).FullName.Replace("+", "."));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(InternalPoolImpl).FullName.Replace("+", "."));
/// <summary>
/// A list of already connected but free to use sockets
View
4 Enyim.Caching/Memcached/PooledSocket.cs
@@ -12,7 +12,7 @@ namespace Enyim.Caching.Memcached
[DebuggerDisplay("[ Address: {endpoint}, IsAlive = {IsAlive} ]")]
public class PooledSocket : IDisposable
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(PooledSocket));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(PooledSocket));
private bool isAlive = true;
private Socket socket;
@@ -375,7 +375,7 @@ public override int Read(byte[] buffer, int offset, int count)
if (errorCode == SocketError.Success && retval > 0)
return retval;
- throw new System.IO.IOException(String.Format("Failed to read from the socket '{0}'. Error: {1}", this.socket.RemoteEndPoint, errorCode));
+ throw new System.IO.IOException(String.Format("Failed to read from the socket '{0}'. Error: {1}", this.socket.RemoteEndPoint, errorCode == SocketError.Success ? "?" : errorCode.ToString()));
}
public override long Seek(long offset, SeekOrigin origin)
View
2 Enyim.Caching/Memcached/Protocol/Binary/BinaryNode.cs
@@ -14,7 +14,7 @@ namespace Enyim.Caching.Memcached.Protocol.Binary
/// </summary>
public class BinaryNode : MemcachedNode
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(BinaryNode));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(BinaryNode));
ISaslAuthenticationProvider authenticationProvider;
View
3 Enyim.Caching/Memcached/Protocol/Binary/BinaryRequest.cs
@@ -7,7 +7,7 @@ namespace Enyim.Caching.Memcached.Protocol.Binary
{
public class BinaryRequest
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(BinaryRequest));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(BinaryRequest));
private static int InstanceCounter;
public OpCode Operation;
@@ -43,7 +43,6 @@ public unsafe IList<ArraySegment<byte>> CreateBuffer(IList<ArraySegment<byte>> a
// body size
ArraySegment<byte> body = this.Data;
int bodyLength = body.Array == null ? 0 : body.Count;
- if (bodyLength > 1024 * 1024) throw new InvalidOperationException("BodyTooLong");
// total payload size
int totalLength = extraLength + keyLength + bodyLength;
View
2 Enyim.Caching/Memcached/Protocol/Binary/BinaryResponse.cs
@@ -5,7 +5,7 @@ namespace Enyim.Caching.Memcached.Protocol.Binary
{
public class BinaryResponse
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(BinaryResponse));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(BinaryResponse));
private const byte MAGIC_VALUE = 0x81;
private const int HEADER_OPCODE = 1;
View
2 Enyim.Caching/Memcached/Protocol/Binary/DeleteOperation.cs
@@ -5,7 +5,7 @@ namespace Enyim.Caching.Memcached.Protocol.Binary
{
public class DeleteOperation : BinarySingleItemOperation, IDeleteOperation
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(DeleteOperation));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(DeleteOperation));
public DeleteOperation(string key) : base(key) { }
protected override BinaryRequest Build()
View
2 Enyim.Caching/Memcached/Protocol/Binary/GetOperation.cs
@@ -5,7 +5,7 @@ namespace Enyim.Caching.Memcached.Protocol.Binary
{
public class GetOperation : BinarySingleItemOperation, IGetOperation
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(GetOperation));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(GetOperation));
private CacheItem result;
public GetOperation(string key) : base(key) { }
View
2 Enyim.Caching/Memcached/Protocol/Binary/MultiGetOperation.cs
@@ -6,7 +6,7 @@ namespace Enyim.Caching.Memcached.Protocol.Binary
{
public class MultiGetOperation : BinaryMultiItemOperation, IMultiGetOperation
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(MultiGetOperation));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(MultiGetOperation));
private Dictionary<string, CacheItem> result;
private Dictionary<int, string> idToKey;
View
2 Enyim.Caching/Memcached/Protocol/Binary/StatsOperation.cs
@@ -7,7 +7,7 @@ namespace Enyim.Caching.Memcached.Protocol.Binary
{
public class StatsOperation : BinaryOperation, IStatsOperation
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(StatsOperation));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(StatsOperation));
private string type;
private Dictionary<string, string> result;
View
2 Enyim.Caching/Memcached/Protocol/Binary/StoreOperation.cs
@@ -5,7 +5,7 @@ namespace Enyim.Caching.Memcached.Protocol.Binary
{
public class StoreOperation : BinarySingleItemOperation, IStoreOperation
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(StoreOperation));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(StoreOperation));
private StoreMode mode;
private CacheItem value;
View
2 Enyim.Caching/Memcached/Protocol/Operation.cs
@@ -8,7 +8,7 @@ namespace Enyim.Caching.Memcached.Protocol
/// </summary>
public abstract class Operation : IOperation
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(Operation));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(Operation));
protected Operation() { }
View
2 Enyim.Caching/Memcached/Protocol/Text/GetHelper.cs
@@ -5,7 +5,7 @@ namespace Enyim.Caching.Memcached.Protocol.Text
{
internal static class GetHelper
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(GetHelper));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(GetHelper));
public static void FinishCurrent(PooledSocket socket)
{
View
2 Enyim.Caching/Memcached/Protocol/Text/MultiGetOperation.cs
@@ -7,7 +7,7 @@ namespace Enyim.Caching.Memcached.Protocol.Text
{
public class MultiGetOperation : MultiItemOperation, IMultiGetOperation
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(MultiGetOperation));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(MultiGetOperation));
private Dictionary<string, CacheItem> result;
View
2 Enyim.Caching/Memcached/Protocol/Text/StatsOperation.cs
@@ -6,7 +6,7 @@ namespace Enyim.Caching.Memcached.Protocol.Text
{
public class StatsOperation : Operation, IStatsOperation
{
- private log4net.ILog log = log4net.LogManager.GetLogger(typeof(StatsOperation));
+ private static Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(StatsOperation));
private string type;
private Dictionary<string, string> result;
View
2 Enyim.Caching/Memcached/Protocol/Text/TextSocketHelper.cs
@@ -14,7 +14,7 @@ internal static class TextSocketHelper
public const string CommandTerminator = "\r\n";
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(TextSocketHelper));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(TextSocketHelper));
/// <summary>
/// Reads the response of the server.
View
2 Enyim.Caching/Memcached/ServerStats.cs
@@ -11,7 +11,7 @@ namespace Enyim.Caching.Memcached
public sealed class ServerStats
{
private const int OpAllowsSum = 1;
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(ServerStats));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(ServerStats));
/// <summary>
/// Defines a value which indicates that the statstics should be retrieved for all servers in the pool.
View
2 Enyim.Caching/MemcachedClient.cs
@@ -20,7 +20,7 @@ public class MemcachedClient : IMemcachedClient
/// </summary>
public static readonly TimeSpan Infinite = TimeSpan.Zero;
internal static readonly MemcachedClientSection DefaultSettings = ConfigurationManager.GetSection("enyim.com/memcached") as MemcachedClientSection;
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(MemcachedClient));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(MemcachedClient));
private IServerPool pool;
private IMemcachedKeyTransformer keyTransformer;
View
11 Enyim.Caching/Properties/AssemblyInfo.cs
@@ -1,7 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;
-[assembly: AssemblyTitle("Enyim.Caching")]
[assembly: AssemblyProduct("Enyim.Caching")]
[assembly: AssemblyCompany("enyim.com")]
@@ -11,18 +10,10 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-[assembly: ComVisible(true)]
+[assembly: ComVisible(false)]
[assembly: Guid("a8cd3f39-7731-4ee8-a7ce-444d540d4a4d")]
-// generated by the build script
-//[assembly: AssemblyVersion("2.4.0.0")]
-//[assembly: AssemblyFileVersion("2.3.0.0")]
-//
-//#if SIGN
-//[assembly: AssemblyKeyName("enyim")]
-//#endif
-
#region [ License information ]
/* ************************************************************
*
View
2 Membase/BucketConfigListener.cs
@@ -10,7 +10,7 @@ namespace Membase
{
internal class BucketConfigListener
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(BucketConfigListener));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(BucketConfigListener));
private Uri[] poolUrls;
private string bucketName;
View
2 Membase/ConfigHelper.cs
@@ -10,7 +10,7 @@ namespace Membase
{
internal class ConfigHelper : IDisposable
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(ConfigHelper));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(ConfigHelper));
private WebClientWithTimeout wcwt;
View
71 Membase/Membase.csproj
@@ -11,61 +11,18 @@
<RootNamespace>Membase</RootNamespace>
<AssemblyName>Membase</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>3.5</OldToolsVersion>
- <UpgradeBackupLocation />
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
+ <Import Project="..\CommonProperties.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE;SIGN</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <NoWarn>1591</NoWarn>
<DocumentationFile>bin\Release\Membase.xml</DocumentationFile>
</PropertyGroup>
- <PropertyGroup>
- <SignAssembly>true</SignAssembly>
- </PropertyGroup>
- <PropertyGroup>
- <AssemblyOriginatorKeyFile>..\localbuild.snk</AssemblyOriginatorKeyFile>
- </PropertyGroup>
<ItemGroup>
- <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\binaries\log4net.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core">
@@ -114,33 +71,9 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<GitTagMatch>ns*</GitTagMatch>
</PropertyGroup>
<Import Project="..\VersionInfo.targets" />
- <!-- 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">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
</Project>
View
2 Membase/MembaseClient.cs
@@ -12,7 +12,7 @@ namespace Membase
/// </summary>
public class MembaseClient : MemcachedClient
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(MembaseClient));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(MembaseClient));
private static IMembaseClientConfiguration DefaultConfig = (IMembaseClientConfiguration)ConfigurationManager.GetSection("membase");
private MembasePool nsPool;
View
2 Membase/MembasePool.cs
@@ -15,7 +15,7 @@ namespace Membase
/// </summary>
internal class MembasePool : IServerPool
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(MembasePool));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(MembasePool));
private IMembaseClientConfiguration configuration;
View
4 Membase/MessageStreamListener.cs
@@ -13,7 +13,7 @@ namespace Membase
/// </summary>
internal class MessageStreamListener : IDisposable
{
- private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(MessageStreamListener));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(MessageStreamListener));
private Uri[] urls;
private int stopCounter = 0;
@@ -47,7 +47,7 @@ public MessageStreamListener(Uri[] urls, Func<WebClientWithTimeout, Uri, Uri> co
this.uriConverter = converter;
// this holds the resolved urls, key is coming from the 'urls' array
- this.realUrls = this.urls.ToDictionary(u => u, u => (Uri)null);
+ this.realUrls = this.urls.Distinct().ToDictionary(u => u, u => (Uri)null);
}
protected event Action<string> MessageReceived;
View
9 Membase/Properties/AssemblyInfo.cs
@@ -1,7 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;
-[assembly: AssemblyTitle("Membase")]
[assembly: AssemblyProduct("Membase")]
[assembly: AssemblyCompany("enyim.com")]
@@ -15,14 +14,6 @@
[assembly: Guid("8460330E-5027-4e2c-AA84-FC8539780160")]
-// generated by the build script
-//[assembly: AssemblyVersion("2.5.0.0")]
-//[assembly: AssemblyFileVersion("2.4.0.0")]
-
-//#if SIGN
-//[assembly: AssemblyKeyName("enyim")]
-//#endif
-
#region [ License information ]
/* ************************************************************
*
View
12 Membase/VBucketAwareOperationFactory.cs
@@ -67,7 +67,7 @@ IFlushOperation IOperationFactory.Flush()
private class VBStore : StoreOperation, IOperationWithState
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(VBStore).FullName.Replace('+', '.'));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(VBStore).FullName.Replace('+', '.'));
private VBucketNodeLocator locator;
private OperationState state;
@@ -115,7 +115,7 @@ OperationState IOperationWithState.State
private class VBDelete : DeleteOperation, IOperationWithState
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(VBDelete).FullName.Replace('+', '.'));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(VBDelete).FullName.Replace('+', '.'));
private VBucketNodeLocator locator;
private OperationState state;
@@ -163,7 +163,7 @@ OperationState IOperationWithState.State
private class VBMutator : MutatorOperation, IOperationWithState
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(VBMutator).FullName.Replace('+', '.'));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(VBMutator).FullName.Replace('+', '.'));
private VBucketNodeLocator locator;
private OperationState state;
@@ -211,7 +211,7 @@ OperationState IOperationWithState.State
private class VBMget : MultiGetOperation
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(VBMget).FullName.Replace('+', '.'));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(VBMget).FullName.Replace('+', '.'));
private VBucketNodeLocator locator;
public VBMget(VBucketNodeLocator locator, IList<string> keys)
@@ -233,7 +233,7 @@ protected override BinaryRequest Build(string key)
private class VBConcat : ConcatOperation, IOperationWithState
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(VBConcat).FullName.Replace('+', '.'));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(VBConcat).FullName.Replace('+', '.'));
private VBucketNodeLocator locator;
private OperationState state;
@@ -281,7 +281,7 @@ OperationState IOperationWithState.State
private class VBGet : GetOperation, IOperationWithState
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(VBGet).FullName.Replace('+', '.'));
+ private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(VBGet).FullName.Replace('+', '.'));
private VBucketNodeLocator locator;
private OperationState state;
View
2 MemcachedTest/MembaseClientTest.cs
@@ -21,7 +21,9 @@ protected override MemcachedClient GetClient()
[TestFixtureSetUp]
public void Init()
{
+#if log4net
log4net.Config.XmlConfigurator.Configure();
+#endif
}
[TestCase]
View
4 MemcachedTest/MemcachedClientTest.cs
@@ -13,7 +13,7 @@ namespace MemcachedTest
[TestFixture]
public abstract class MemcachedClientTest
{
- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(MemcachedClientTest));