-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathExtensions.cs
More file actions
43 lines (38 loc) · 1006 Bytes
/
Copy pathExtensions.cs
File metadata and controls
43 lines (38 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System.Runtime.CompilerServices;
namespace CreateMatrix;
internal static class LogExtensions
{
extension(ILogger logger)
{
internal bool LogAndPropagate(
Exception exception,
[CallerMemberName] string function = "unknown"
)
{
logger.Error(exception, "{Function}", function);
return false;
}
internal bool LogAndHandle(
Exception exception,
[CallerMemberName] string function = "unknown"
)
{
logger.Error(exception, "{Function}", function);
return true;
}
}
}
internal static class StringBuilderExtensions
{
extension(StringBuilder sb)
{
internal StringBuilder AppendLineCrlf(string? value = null)
{
if (value is not null)
{
_ = sb.Append(value);
}
return sb.Append("\r\n");
}
}
}