Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #31 from datalust/dev
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
nblumhardt authored May 26, 2020
2 parents 0c5dd94 + c564d4e commit 0669528
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 41 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ Expressions using the [_Serilog.Filters.Expressions_](https://github.com/serilog

Output will be plain text unless another format is specified.

Write the output in CLEF format using `--format-clef`:
Write the output in JSON format using `--format-json`:

```
> clef -i log-20170509.clef --format-clef
> clef -i log-20170509.clef --format-json
{"@t":"2017-05-09T01:23:45.67890Z","@mt":"Starting up"}
...
```
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 1.0.{build}
skip_tags: true
image: Visual Studio 2017
image: Visual Studio 2019
build_script:
- ps: ./Build.ps1
test: off
Expand Down
2 changes: 2 additions & 0 deletions clef-tool.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -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:Boolean x:Key="/Default/UserDictionary/Words/=Datalust/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
8 changes: 4 additions & 4 deletions setup/Datalust.ClefTool.Setup/Datalust.ClefTool.Setup.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<Target Name="BeforeBuild">
<Exec Command="dotnet publish ..\..\src\Datalust.ClefTool\Datalust.ClefTool.csproj -c $(Configuration) -r win10-x64" />
<Exec Command="dotnet publish ..\..\src\Datalust.ClefTool\Datalust.ClefTool.csproj -c $(Configuration) -r win81-x64" />
<PropertyGroup>
<LinkerBaseInputPaths>..\..\src\Datalust.ClefTool\bin\$(Configuration)\netcoreapp1.1\win10-x64\publish</LinkerBaseInputPaths>
<DefineConstants>BasePath=..\..\src\Datalust.ClefTool\bin\$(Configuration)\netcoreapp1.1\win10-x64\publish</DefineConstants>
<LinkerBaseInputPaths>..\..\src\Datalust.ClefTool\bin\$(Configuration)\netcoreapp3.1\win81-x64\publish</LinkerBaseInputPaths>
<DefineConstants>BasePath=..\..\src\Datalust.ClefTool\bin\$(Configuration)\netcoreapp3.1\win81-x64\publish</DefineConstants>
</PropertyGroup>
<HeatDirectory OutputFile="ClefTool.wxs" Directory="..\..\src\Datalust.ClefTool\bin\$(Configuration)\netcoreapp1.1\win10-x64\publish" DirectoryRefId="INSTALLFOLDER" ComponentGroupName="ClefTool_Project" SuppressCom="true" SuppressFragments="true" SuppressRegistry="true" SuppressRootDirectory="true" AutoGenerateGuids="false" GenerateGuidsNow="true" ToolPath="$(WixToolPath)" PreprocessorVariable="var.BasePath" Transforms="RemovePdbs.xslt" />
<HeatDirectory OutputFile="ClefTool.wxs" Directory="..\..\src\Datalust.ClefTool\bin\$(Configuration)\netcoreapp3.1\win81-x64\publish" DirectoryRefId="INSTALLFOLDER" ComponentGroupName="ClefTool_Project" SuppressCom="true" SuppressFragments="true" SuppressRegistry="true" SuppressRootDirectory="true" AutoGenerateGuids="false" GenerateGuidsNow="true" ToolPath="$(WixToolPath)" PreprocessorVariable="var.BasePath" Transforms="RemovePdbs.xslt" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
19 changes: 9 additions & 10 deletions src/Datalust.ClefTool/Cli/Commands/PipeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
using Serilog.Formatting.Compact.Reader;
using Serilog.Formatting.Display;

// ReSharper disable UnusedType.Global

namespace Datalust.ClefTool.Cli.Commands
{
[Command("pipe", "Process CLEF-formatted events")]
Expand All @@ -25,8 +27,7 @@ class PipeCommand : Command
readonly SeqOutputFeature _seqOutputFeature;
readonly InvalidDataHandlingFeature _invalidDataHandlingFeature;

// Include `{Properties}` once it's supported (Serilog 2.5)
const string DefaultOutputTemplate = "[{Timestamp:o} {Level:u3}] {Message}{NewLine}{Exception}";
const string DefaultOutputTemplate = "[{Timestamp:o} {Level:u3}] {Message} {Properties}{NewLine}{Exception}";

public PipeCommand()
{
Expand Down Expand Up @@ -98,19 +99,17 @@ protected override int Run()
}
else
{
configuration.WriteTo.LiterateConsole(outputTemplate: template);
configuration.WriteTo.Console(outputTemplate: template);
}
}

using (var logger = configuration.CreateLogger())
using (var inputFile = _fileInputFeature.InputFilename != null
using var logger = configuration.CreateLogger();
using var inputFile = _fileInputFeature.InputFilename != null
? new StreamReader(File.Open(_fileInputFeature.InputFilename, FileMode.Open, FileAccess.Read,
FileShare.ReadWrite))
: null)
using (var reader = new LogEventReader(inputFile ?? Console.In))
{
EventPipe.PipeEvents(reader, logger, _invalidDataHandlingFeature.InvalidDataHandling);
}
: null;
using var reader = new LogEventReader(inputFile ?? Console.In);
EventPipe.PipeEvents(reader, logger, _invalidDataHandlingFeature.InvalidDataHandling);

return failed ? 1 : 0;
}
Expand Down
21 changes: 10 additions & 11 deletions src/Datalust.ClefTool/Datalust.ClefTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifiers>win81-x64</RuntimeIdentifiers>
<AssemblyName>clef</AssemblyName>
<ApplicationIcon>ClefTool.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="autofac" Version="4.5.0" />
<PackageReference Include="serilog" Version="2.4.0" />
<PackageReference Include="serilog.filters.expressions" Version="1.0.1" />
<PackageReference Include="serilog.formatting.compact" Version="1.0.0" />
<PackageReference Include="serilog.formatting.compact.reader" Version="1.0.2" />
<PackageReference Include="serilog.sinks.console" Version="2.1.0" />
<PackageReference Include="serilog.sinks.file" Version="3.2.0" />
<PackageReference Include="serilog.sinks.literate" Version="2.1.0" />
<PackageReference Include="serilog.sinks.seq" Version="3.2.0" />
<PackageReference Include="autofac" Version="5.2.0" />
<PackageReference Include="serilog" Version="2.9.0" />
<PackageReference Include="serilog.filters.expressions" Version="2.1.0" />
<PackageReference Include="serilog.formatting.compact" Version="1.1.0" />
<PackageReference Include="serilog.formatting.compact.reader" Version="1.0.3" />
<PackageReference Include="serilog.sinks.console" Version="3.1.1" />
<PackageReference Include="serilog.sinks.file" Version="4.1.0" />
<PackageReference Include="serilog.sinks.seq" Version="4.0.0" />
</ItemGroup>
</Project>
19 changes: 6 additions & 13 deletions test/Datalust.ClefTool.Tests/Datalust.ClefTool.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="serilog" Version="2.9.0" />
<PackageReference Include="serilog.formatting.compact.reader" Version="1.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Datalust.ClefTool\Datalust.ClefTool.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="Serilog">
<HintPath>..\..\..\..\..\Users\nblumhardt\.nuget\packages\serilog\2.4.0\lib\netstandard1.3\Serilog.dll</HintPath>
</Reference>
<Reference Include="Serilog.Formatting.Compact.Reader">
<HintPath>..\..\..\..\..\Users\nblumhardt\.nuget\packages\serilog.formatting.compact.reader\1.0.0\lib\netstandard1.0\Serilog.Formatting.Compact.Reader.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
Expand Down

0 comments on commit 0669528

Please sign in to comment.