Skip to content

Commit dd55387

Browse files
committed
readme update
1 parent 6663682 commit dd55387

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,54 @@
22

33
A collection of helper functions for the [Serilog.Extensions.Logging](https://www.nuget.org/packages/Serilog.Extensions.Logging) logging tool.
44

5-
65
## Status
76

87
| | |
98
|----------------------:|-----------------------|
109
| Nuget Package Version | [![Nuget Version](https://img.shields.io/nuget/v/jjm.one.Serilog.Extensions.Logging.Helpers?style=flat-square)](https://www.nuget.org/packages/jjm.one.Serilog.Extensions.Logging.Helpers/) |
11-
äa,.dföä,a
10+
11+
## Table of contents
12+
13+
- [jjm.one.Serilog.Extensions.Logging.Helpers](#jjmoneserilogextensionslogginghelpers)
14+
- [Status](#status)
15+
- [Table of contents](#table-of-contents)
16+
- [Usage](#usage)
17+
- [Use function logging](#use-function-logging)
18+
- [Output of function logging](#output-of-function-logging)
19+
20+
## Usage
21+
22+
### Use function logging
23+
24+
```csharp
25+
class MyClass {
26+
27+
// ...
28+
29+
void MyFancyFunction() {
30+
31+
// log the function call
32+
Log.Logger.LogFctCall(GetType(), MethodBase.GetCurrentMethod(), LogEventLevel.Debug);
33+
34+
try {
35+
36+
//...
37+
}
38+
catch (Exception exc) {
39+
40+
// Log the exception
41+
Log.Logger.LogExcInFctCall(exc, GetType(), MethodBase.GetCurrentMethod(), "My custom exception message!", LogEventLevel.Error);
42+
}
43+
}
44+
45+
// ...
46+
}
47+
```
48+
49+
### Output of function logging
50+
51+
```text
52+
Function called: MyClass -> MyFancyFunction
53+
Exception thrown in: MyClass -> MyFancyFunction
54+
My custom exception message!
55+
```

0 commit comments

Comments
 (0)