-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ghost1face/package
Package
- Loading branch information
Showing
13 changed files
with
181 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 6.0.x | ||
- run: dotnet build --configuration Release . | ||
- name: Publish the package to nuget.org | ||
run: dotnet nuget push src/BeyondTech.Extensions.Logging.Timing/bin/Release/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json --skip-duplicate | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.NUGET_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
**/[Ll]og/ | ||
**/.vs/ | ||
**/.vscode/ | ||
*.csproj.user | ||
*.csproj.user | ||
coverage.*.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;netstandard2.1;netstandard2.0</TargetFrameworks> | ||
<Version>1.0.0</Version> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,31 @@ | ||
# BeyondTech Logging Extensions | ||
|
||
### Timing [![Coverage Status](https://coveralls.io/repos/github/ghost1face/beyondtech-extensions-logging/badge.svg?branch=master)](https://coveralls.io/github/ghost1face/beyondtech-extensions-logging?branch=master) | ||
Extensions for Microsoft's `ILogger` for common use cases. | ||
|
||
Timing extensions for logging [here](./src/BeyondTech.Extensions.Logging.Timing/README.md) | ||
## BeyondTech.Extensions.Logging.Timing | ||
[![.NET Actions Status](https://github.com/ghost1face/beyondtech-extensions-logging/workflows/.NET/badge.svg?branch=master)](https://github.com/ghost1face/beyondtech-extensions-logging/actions) [![Coverage Status](https://coveralls.io/repos/github/ghost1face/beyondtech-extensions-logging/badge.svg?branch=master)](https://coveralls.io/github/ghost1face/beyondtech-extensions-logging?branch=master) | ||
[![Nuget](https://img.shields.io/nuget/v/BeyondTech.Extensions.Logging.Timing.svg)](https://www.nuget.org/packages/BeyondTech.Extensions.Logging.Timing) | ||
|
||
|
||
Timing extensions for logging operations: [here](./src/BeyondTech.Extensions.Logging.Timing/README.md) | ||
|
||
This lets you perfom simple logging for timed operations, while simplifying the boilerplate: | ||
|
||
```cs | ||
ILogger logger = // assign instance | ||
using (var operation = logger.BeginOperation("Processing large file {FilePath}", filePath)) | ||
{ | ||
operation.Complete(); | ||
} | ||
``` | ||
|
||
Yields: | ||
|
||
``` | ||
info: Processing large file /d/test/image.png completed in 822.5 ms | ||
``` | ||
|
||
### License | ||
|
||
See the [license](LICENSE.md) | ||
Licensed under [Apache 2.0](LICENSE.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 38 additions & 1 deletion
39
src/BeyondTech.Extensions.Logging.Timing/BeyondTech.Extensions.Logging.Timing.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,51 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;netstandard2.1;netstandard2.0</TargetFrameworks> | ||
<TargetFrameworks>$(TargetFrameworks)</TargetFrameworks> | ||
<Version>$(Version)</Version> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<Nullable>enable</Nullable> | ||
<LangVersion>10</LangVersion> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<WarningsAsErrors /> | ||
<Authors>ghost1face</Authors> | ||
<Copyright>2022</Copyright> | ||
<Description>Extends ILogger for support for timed operations</Description> | ||
<PackageProjectUrl>https://github.com/ghost1face/beyondtech-extensions-logging</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/ghost1face/beyondtech-extensions-logging</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<PackageTags>csharp;logging;ilogger;extensions;timing;metrics;operations;</PackageTags> | ||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<PackageReleaseNotes>Initial release</PackageReleaseNotes> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="$(Configuration) == 'Release'"> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.0" /> | ||
<PackageReference Include="Microsoft.SourceLink.Github" Version="1.1.1"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\LICENSE.md"> | ||
<Pack>True</Pack> | ||
<PackagePath></PackagePath> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters