Skip to content

Commit a5dc176

Browse files
committed
Merge branch 'master' into dev
# Conflicts: # src/Serilog.Extensions.Logging/project.json
2 parents d00d55c + 50d9dba commit a5dc176

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ deploy:
2727
tag: v$(appveyor_build_version)
2828
on:
2929
branch: master
30+

src/Serilog.Extensions.Logging/SerilogLoggerFactoryExtensions.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System;
55
using Microsoft.Extensions.Logging;
66
using Serilog.Extensions.Logging;
7+
using System.ComponentModel;
78

89
namespace Serilog
910
{
@@ -12,6 +13,21 @@ namespace Serilog
1213
/// </summary>
1314
public static class SerilogLoggerFactoryExtensions
1415
{
16+
/// <summary>
17+
/// Add Serilog to the logging pipeline.
18+
/// </summary>
19+
/// <param name="factory">The logger factory to configure.</param>
20+
/// <param name="logger">The Serilog logger; if not supplied, the static <see cref="Serilog.Log"/> will be used.</param>
21+
/// <returns>The logger factory.</returns>
22+
[EditorBrowsable(EditorBrowsableState.Never)]
23+
public static ILoggerFactory AddSerilog(
24+
this ILoggerFactory factory,
25+
ILogger logger)
26+
{
27+
if (factory == null) throw new ArgumentNullException(nameof(factory));
28+
return factory.AddSerilog(logger, false);
29+
}
30+
1531
/// <summary>
1632
/// Add Serilog to the logging pipeline.
1733
/// </summary>

0 commit comments

Comments
 (0)