Skip to content

Commit 81082ff

Browse files
committed
adds more usage examples to README.md
1 parent 2f87872 commit 81082ff

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ A collection of helper functions for the [Serilog.Extensions.Logging](https://ww
1616
- [Status](#status)
1717
- [Table of contents](#table-of-contents)
1818
- [Nuget Package](#nuget-package)
19+
- [Installing the Nuget Package](#installing-the-nuget-package)
1920
- [Usage](#usage)
2021
- [Use function logging](#use-function-logging)
2122
- [Output of function logging](#output-of-function-logging)
@@ -26,6 +27,18 @@ A collection of helper functions for the [Serilog.Extensions.Logging](https://ww
2627

2728
You can get the latest version of this software as a nuget package form [nuget.org](https://www.nuget.org/packages/jjm.one.Serilog.Extensions.Logging.Helpers/)
2829

30+
### Installing the Nuget Package
31+
32+
| Tool | Command/Code |
33+
|----------------------|--------------|
34+
| Package Manager | ```PM> Install-Package jjm.one.Serilog.Extensions.Logging.Helper -Version X.Y.Z``` |
35+
| .NET CLI | ```> dotnet add package jjm.one.Serilog.Extensions.Logging.Helper --version X.Y.Z``` |
36+
| PackageReference | ```<PackageReference Include="jjm.one.Serilog.Extensions.Logging.Helper" Version="X.Y.Z" />``` |
37+
| Package CLI | ```> paket add jjm.one.Serilog.Extensions.Logging.Helper --version X.Y.Z``` |
38+
| Script & Interactive | ```> #r "nuget: jjm.one.Serilog.Extensions.Logging.Helper, X.Y.Z"``` |
39+
| Cake as Addin | ```#addin nuget:?package=jjm.one.Serilog.Extensions.Logging.Helper&version=X.Y.Z``` |
40+
| Cake as Tool | ```#tool nuget:?package=jjm.one.Serilog.Extensions.Logging.Helper&version=X.Y.Z``` |
41+
2942
## Usage
3043

3144
### Use function logging
@@ -37,7 +50,10 @@ class MyClass {
3750
3851
void MyFancyFunction() {
3952

40-
// log the function call
53+
// log the function call (minimal parameters)
54+
Log.Logger.LogFctCall();
55+
56+
// log the function call (full parameters)
4157
Log.Logger.LogFctCall(GetType(), MethodBase.GetCurrentMethod(), LogEventLevel.Debug);
4258

4359
try {
@@ -46,7 +62,10 @@ class MyClass {
4662
}
4763
catch (Exception exc) {
4864

49-
// Log the exception
65+
// Log the exception (minimal parameters)
66+
Log.Logger.LogExcInFctCall(exc);
67+
68+
// Log the exception (full parameters)
5069
Log.Logger.LogExcInFctCall(exc, GetType(), MethodBase.GetCurrentMethod(), "My custom exception message!", LogEventLevel.Error);
5170
}
5271
}

0 commit comments

Comments
 (0)