Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial split into portable core

  • Loading branch information...
commit fe7afa6060ca442e26a6311754003af95720f5cb 1 parent 270910f
@onovotny onovotny authored
View
2  MetroLog/Targets/FileSnapshotTarget.cs → MetroLog.NetCore/FileSnapshotTarget.cs
@@ -71,7 +71,7 @@ private static void SinkException(Exception ex)
// no-op - just preventing compile warnings...
}
- protected internal override async Task<LogWriteOperation> WriteAsync(LogEventInfo entry)
+ protected override async Task<LogWriteOperation> WriteAsync(LogEventInfo entry)
{
var folder = await EnsureInitializedAsync();
if (folder == null)
View
21 MetroLog.NetCore/LogConfig.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MetroLog.Targets;
+
+namespace MetroLog
+{
+ public static class LogConfig
+ {
+ public static void InitializeDefault()
+ {
+ var configuration = new LoggingConfiguration();
+ configuration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new DebugTarget());
+ configuration.AddTarget(LogLevel.Error, LogLevel.Fatal, new FileSnapshotTarget());
+
+ LogManager.Reset(configuration);
+ }
+ }
+}
View
138 MetroLog.NetCore/MetroLog.NetCore.csproj
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{429EE5FC-46FE-4249-BB40-8DC6D9023A04}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MetroLog</RootNamespace>
+ <AssemblyName>MetroLog.NetCore</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\ARM\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>ARM</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
+ <OutputPath>bin\ARM\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>ARM</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x64\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+ <OutputPath>bin\x64\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>bin\x86\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+ <OutputPath>bin\x86\Release\</OutputPath>
+ <DefineConstants>TRACE;NETFX_CORE</DefineConstants>
+ <Optimize>true</Optimize>
+ <NoWarn>;2008</NoWarn>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <UseVSHostingProcess>false</UseVSHostingProcess>
+ <ErrorReport>prompt</ErrorReport>
+ <Prefer32Bit>true</Prefer32Bit>
+ </PropertyGroup>
+ <ItemGroup>
+ <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
+ <ProjectReference Include="..\MetroLog\MetroLog.csproj">
+ <Project>{65e2062e-aac2-4054-aae6-d6764040c769}</Project>
+ <Name>MetroLog</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\SharedAssemblyInfo.cs">
+ <Link>Properties\SharedAssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="FileSnapshotTarget.cs" />
+ <Compile Include="LogConfig.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\MetroLog.snk">
+ <Link>MetroLog.snk</Link>
+ </None>
+ </ItemGroup>
+ <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0' ">
+ <VisualStudioVersion>11.0</VisualStudioVersion>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>..\MetroLog.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.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
11 MetroLog.NetCore/Properties/AssemblyInfo.cs
@@ -0,0 +1,11 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("MetroLog.NetCore")]
+[assembly: AssemblyProduct("MetroLog.NetCore")]
+
+[assembly: ComVisible(false)]
View
72 MetroLog.NetFx/MetroLog.NetFx.csproj
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{B929FFC8-CA0D-43FD-A95B-8E454CCD7133}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>MetroLog</RootNamespace>
+ <AssemblyName>MetroLog.NetFx</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <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>
+ </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>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>..\MetroLog.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\SharedAssemblyInfo.cs">
+ <Link>Properties\SharedAssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\MetroLog\MetroLog.csproj">
+ <Project>{65e2062e-aac2-4054-aae6-d6764040c769}</Project>
+ <Name>MetroLog</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\MetroLog.snk">
+ <Link>MetroLog.snk</Link>
+ </None>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\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
18 MetroLog.NetFx/Properties/AssemblyInfo.cs
@@ -0,0 +1,18 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("MetroLog.NetFx")]
+[assembly: AssemblyProduct("MetroLog.NetFx")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("062692e3-ba44-4e7c-8795-e41f77518691")]
+
View
4 MetroLog.Tests/MetroLog.Tests.csproj
@@ -141,6 +141,10 @@
</Content>
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\MetroLog.NetCore\MetroLog.NetCore.csproj">
+ <Project>{429ee5fc-46fe-4249-bb40-8dc6d9023a04}</Project>
+ <Name>MetroLog.NetCore</Name>
+ </ProjectReference>
<ProjectReference Include="..\MetroLog\MetroLog.csproj">
<Project>{65e2062e-aac2-4054-aae6-d6764040c769}</Project>
<Name>MetroLog</Name>
View
55 MetroLog.sln
@@ -8,60 +8,91 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B59C05D2-3F0D-40CB-8753-7F63D458AF00}"
ProjectSection(SolutionItems) = preProject
README.mdown = README.mdown
+ SharedAssemblyInfo.cs = SharedAssemblyInfo.cs
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetroLog.NetFx", "MetroLog.NetFx\MetroLog.NetFx.csproj", "{B929FFC8-CA0D-43FD-A95B-8E454CCD7133}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetroLog.NetCore", "MetroLog.NetCore\MetroLog.NetCore.csproj", "{429EE5FC-46FE-4249-BB40-8DC6D9023A04}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|ARM = Debug|ARM
Debug|Any CPU = Debug|Any CPU
+ Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
- Release|ARM = Release|ARM
Release|Any CPU = Release|Any CPU
+ Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {65E2062E-AAC2-4054-AAE6-D6764040C769}.Debug|ARM.ActiveCfg = Debug|ARM
- {65E2062E-AAC2-4054-AAE6-D6764040C769}.Debug|ARM.Build.0 = Debug|ARM
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {65E2062E-AAC2-4054-AAE6-D6764040C769}.Debug|ARM.ActiveCfg = Debug|ARM
+ {65E2062E-AAC2-4054-AAE6-D6764040C769}.Debug|ARM.Build.0 = Debug|ARM
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Debug|x64.ActiveCfg = Debug|x64
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Debug|x64.Build.0 = Debug|x64
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Debug|x86.ActiveCfg = Debug|x86
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Debug|x86.Build.0 = Debug|x86
- {65E2062E-AAC2-4054-AAE6-D6764040C769}.Release|ARM.ActiveCfg = Release|ARM
- {65E2062E-AAC2-4054-AAE6-D6764040C769}.Release|ARM.Build.0 = Release|ARM
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Release|Any CPU.Build.0 = Release|Any CPU
+ {65E2062E-AAC2-4054-AAE6-D6764040C769}.Release|ARM.ActiveCfg = Release|ARM
+ {65E2062E-AAC2-4054-AAE6-D6764040C769}.Release|ARM.Build.0 = Release|ARM
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Release|x64.ActiveCfg = Release|x64
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Release|x64.Build.0 = Release|x64
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Release|x86.ActiveCfg = Release|x86
{65E2062E-AAC2-4054-AAE6-D6764040C769}.Release|x86.Build.0 = Release|x86
- {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|ARM.ActiveCfg = Debug|ARM
- {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|ARM.Build.0 = Debug|ARM
- {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|ARM.Deploy.0 = Debug|ARM
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|ARM.ActiveCfg = Debug|ARM
+ {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|ARM.Build.0 = Debug|ARM
+ {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|ARM.Deploy.0 = Debug|ARM
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|x64.ActiveCfg = Debug|x64
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|x64.Build.0 = Debug|x64
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|x64.Deploy.0 = Debug|x64
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|x86.ActiveCfg = Debug|x86
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|x86.Build.0 = Debug|x86
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Debug|x86.Deploy.0 = Debug|x86
- {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|ARM.ActiveCfg = Release|ARM
- {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|ARM.Build.0 = Release|ARM
- {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|ARM.Deploy.0 = Release|ARM
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|Any CPU.Build.0 = Release|Any CPU
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|ARM.ActiveCfg = Release|ARM
+ {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|ARM.Build.0 = Release|ARM
+ {DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|ARM.Deploy.0 = Release|ARM
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|x64.ActiveCfg = Release|x64
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|x64.Build.0 = Release|x64
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|x64.Deploy.0 = Release|x64
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|x86.ActiveCfg = Release|x86
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|x86.Build.0 = Release|x86
{DA25A63D-03A0-4866-84FF-48A2A8CF9101}.Release|x86.Deploy.0 = Release|x86
+ {B929FFC8-CA0D-43FD-A95B-8E454CCD7133}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B929FFC8-CA0D-43FD-A95B-8E454CCD7133}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B929FFC8-CA0D-43FD-A95B-8E454CCD7133}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {B929FFC8-CA0D-43FD-A95B-8E454CCD7133}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B929FFC8-CA0D-43FD-A95B-8E454CCD7133}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B929FFC8-CA0D-43FD-A95B-8E454CCD7133}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B929FFC8-CA0D-43FD-A95B-8E454CCD7133}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B929FFC8-CA0D-43FD-A95B-8E454CCD7133}.Release|ARM.ActiveCfg = Release|Any CPU
+ {B929FFC8-CA0D-43FD-A95B-8E454CCD7133}.Release|x64.ActiveCfg = Release|Any CPU
+ {B929FFC8-CA0D-43FD-A95B-8E454CCD7133}.Release|x86.ActiveCfg = Release|Any CPU
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Debug|ARM.ActiveCfg = Debug|ARM
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Debug|ARM.Build.0 = Debug|ARM
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Debug|x64.ActiveCfg = Debug|x64
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Debug|x64.Build.0 = Debug|x64
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Debug|x86.ActiveCfg = Debug|x86
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Debug|x86.Build.0 = Debug|x86
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Release|Any CPU.Build.0 = Release|Any CPU
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Release|ARM.ActiveCfg = Release|ARM
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Release|ARM.Build.0 = Release|ARM
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Release|x64.ActiveCfg = Release|x64
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Release|x64.Build.0 = Release|x64
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Release|x86.ActiveCfg = Release|x86
+ {429EE5FC-46FE-4249-BB40-8DC6D9023A04}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
2  MetroLog.sln.DotSettings
@@ -0,0 +1,2 @@
+<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
+ <s:String x:Key="/Default/CodeStyle/CSharpUsing/KeepImports/=System_002EThreading_002ETasks/@EntryIndexedValue">System.Threading.Tasks</s:String></wpf:ResourceDictionary>
View
BIN  MetroLog.snk
Binary file not shown
View
2  MetroLog/Layouts/FileSnapshotLayout.cs
@@ -8,7 +8,7 @@ namespace MetroLog.Layouts
{
public class FileSnapshotLayout : Layout
{
- protected internal override string GetFormattedString(LogEventInfo info)
+ public override string GetFormattedString(LogEventInfo info)
{
StringBuilder builder = new StringBuilder();
builder.Append("Sequence: ");
View
2  MetroLog/Layouts/Layout.cs
@@ -12,6 +12,6 @@ protected Layout()
{
}
- protected internal abstract string GetFormattedString(LogEventInfo info);
+ public abstract string GetFormattedString(LogEventInfo info);
}
}
View
2  MetroLog/Layouts/SingleLineLayout.cs
@@ -8,7 +8,7 @@ namespace MetroLog.Layouts
{
public class SingleLineLayout : Layout
{
- protected internal override string GetFormattedString(LogEventInfo info)
+ public override string GetFormattedString(LogEventInfo info)
{
StringBuilder builder = new StringBuilder();
builder.Append(info.TimeStamp.ToString(LogManager.DateTimeFormat));
View
25 MetroLog/MetroLog.csproj
@@ -13,7 +13,9 @@
<AssemblyName>MetroLog</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -99,15 +101,16 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
- <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
- </ItemGroup>
- <ItemGroup>
+ <Compile Include="..\SharedAssemblyInfo.cs">
+ <Link>Properties\SharedAssemblyInfo.cs</Link>
+ </Compile>
<Compile Include="Layouts\FileSnapshotLayout.cs" />
<Compile Include="Layouts\Layout.cs" />
<Compile Include="Layouts\SingleLineLayout.cs" />
<Compile Include="Objects\FrameworkLogger.cs" />
<Compile Include="Objects\ILoggable.cs" />
<Compile Include="Objects\ILoggableExtender.cs" />
+ <Compile Include="Objects\ILogManager.cs" />
<Compile Include="Objects\LogEventInfo.cs" />
<Compile Include="Objects\Logger.cs" />
<Compile Include="Objects\LoggingConfiguration.cs" />
@@ -119,13 +122,23 @@
<Compile Include="Targets\TargetBinding.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Targets\DebugTarget.cs" />
- <Compile Include="Targets\FileSnapshotTarget.cs" />
<Compile Include="Targets\Target.cs" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="..\MetroLog.snk">
+ <Link>MetroLog.snk</Link>
+ </None>
+ </ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0' ">
<VisualStudioVersion>11.0</VisualStudioVersion>
</PropertyGroup>
- <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>..\MetroLog.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.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">
View
12 MetroLog/Objects/ILogManager.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MetroLog.Objects
+{
+ public interface ILogManager
+ {
+ }
+}
View
2  MetroLog/Objects/LogEventInfo.cs
@@ -14,7 +14,7 @@ public class LogEventInfo
public string Message { get; private set; }
public Exception Exception { get; private set; }
public long SequenceID { get; private set; }
- public DateTime TimeStamp { get; private set; }
+ public DateTimeOffset TimeStamp { get; private set; }
private static long _globalSequenceId;
View
20 MetroLog/Objects/LogManager.cs
@@ -14,7 +14,7 @@ public static class LogManager
public static LoggingConfiguration DefaultConfiguration { get; set; }
private static Dictionary<string, Logger> Loggers { get; set; }
- private static object _loggersLock = new object();
+ private static readonly object _loggersLock = new object();
internal const string DateTimeFormat = "dd/MMM/yyyy HH:mm:ss";
@@ -38,15 +38,17 @@ public static Logger GetLogger(string name, LoggingConfiguration config = null)
}
}
- public static void Reset()
+ public static void Reset(LoggingConfiguration configuration = null)
{
Loggers = new Dictionary<string, Logger>(StringComparer.OrdinalIgnoreCase);
- // default logging config...
- var config = new LoggingConfiguration();
- config.AddTarget(LogLevel.Trace, LogLevel.Fatal, new DebugTarget());
- config.AddTarget(LogLevel.Error, LogLevel.Fatal, new FileSnapshotTarget());
- DefaultConfiguration = config;
+ if (configuration == null)
+ {
+ // default logging config...
+ configuration = new LoggingConfiguration();
+ configuration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new DebugTarget());
+ }
+ DefaultConfiguration = configuration;
}
// logs problems with the framework to Debug...
@@ -58,10 +60,10 @@ internal static void LogInternal(string message, Exception ex)
Debug.WriteLine("{0}|INTERNAL|(null)|{1}", GetDateTime().ToString(DateTimeFormat), message);
}
- internal static DateTime GetDateTime()
+ internal static DateTimeOffset GetDateTime()
{
// NLog has a high efficiency version of this...
- return DateTime.Now;
+ return DateTimeOffset.UtcNow;
}
}
}
View
8 MetroLog/Objects/LogWriteOperation.cs
@@ -9,11 +9,11 @@ namespace MetroLog
{
public struct LogWriteOperation
{
- private Target _target;
- private LogEventInfo _entry;
- private bool _success;
+ private readonly Target _target;
+ private readonly LogEventInfo _entry;
+ private readonly bool _success;
- internal LogWriteOperation(Target target, LogEventInfo entry, bool success)
+ public LogWriteOperation(Target target, LogEventInfo entry, bool success)
{
_target = target;
_entry = entry;
View
3  MetroLog/Objects/Logger.cs
@@ -17,8 +17,7 @@ internal Logger(string name, LoggingConfiguration config)
this.Name = name;
// add a target...
- if (config != null)
- this.Configuration = config.Clone();
+ this.Configuration = config;
}
private LoggingConfiguration ResolvedConfiguration
View
12 MetroLog/Objects/LoggingConfiguration.cs
@@ -28,18 +28,10 @@ public void AddTarget(LogLevel min, LogLevel max, Target target)
this.Bindings.Add(new TargetBinding(min, max, target));
}
- internal LoggingConfiguration Clone()
- {
- throw new NotImplementedException();
- }
-
internal IEnumerable<Target> GetTargets(LogLevel level)
{
- var results = new List<Target>();
- foreach (var binding in this.Bindings.Where(v => v.SupportsLevel(level)))
- results.Add(binding.Target);
-
- return results;
+ lock(_bindingsLock)
+ return this.Bindings.Where(v => v.SupportsLevel(level)).Select(binding => binding.Target).ToList();
}
public void ClearTargets()
View
26 MetroLog/Properties/AssemblyInfo.cs
@@ -1,29 +1,11 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+using System.Security;
+
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("MetroLog")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MetroLog")]
-[assembly: AssemblyCopyright("Copyright © 2012")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.5.0.0")]
-[assembly: AssemblyFileVersion("0.5.0.0")]
-[assembly: ComVisible(false)]
+[assembly: ComVisible(false)]
+[assembly: SecurityTransparent]
View
26 SharedAssemblyInfo.cs
@@ -0,0 +1,26 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("0.5.0.0")]
+[assembly: AssemblyFileVersion("0.5.0.0")]

0 comments on commit fe7afa6

Please sign in to comment.
Something went wrong with that request. Please try again.