Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding netstandard 2.0 logging abstraction support #83

Merged
merged 9 commits into from
Jul 17, 2017

Conversation

gertjvr
Copy link
Contributor

@gertjvr gertjvr commented Jul 14, 2017

This is ready to be reviewed!

@nblumhardt
Copy link
Member

Awesome, thanks Gert 👍

@gertjvr
Copy link
Contributor Author

gertjvr commented Jul 14, 2017

First time working with multi targeting csproj any tips would be helpful.

@nblumhardt
Copy link
Member

May not have a chance to look at it today, but we've done a lot of multi-targeting in various Serilog projects, so if you hit any blockers, posting here should yield some tips :-)

@gertjvr
Copy link
Contributor Author

gertjvr commented Jul 14, 2017

Will have to comeback to it later, it builds locally for me, not sure why appveyor is not finding the preview packages.

@gertjvr gertjvr changed the title WIP Adding netstandard 2.0 logging abstraction support Adding netstandard 2.0 logging abstraction support Jul 15, 2017
Copy link
Member

@nblumhardt nblumhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Couple of minor suggestions.

/// <param name="logger">The Serilog logger; if not supplied, the static <see cref="Serilog.Log"/> will be used.</param>
/// <returns>The logger factory.</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
public static IServiceCollection AddSerilog(this IServiceCollection services, ILogger logger)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method can be removed - the reason for it appearing in SerilogLoggerFactoryExtensions is backwards binary compatibility.

@@ -4,7 +4,7 @@
<Description>Serilog provider for Microsoft.Extensions.Logging</Description>
<VersionPrefix>1.4.1</VersionPrefix>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could rev this to 2.0.0 to signal the update supporting the new MEL.

@nblumhardt
Copy link
Member

Thanks a million for the PR, Gert :-)

I'm still wrapping my head around some of the targeting requirements (the new logging packages still target netstandard1.1, for instance, so we don't strictly need to target netstandard2.0 AFAICT), but this will definitely get us started and seems the lowest-churn way forward 👍

@nblumhardt nblumhardt merged commit 7a92b2f into serilog:dev Jul 17, 2017
@nblumhardt
Copy link
Member

We're in business :-) Thanks @gertjvr.

@pakrym @davidfowl @BrennanConroy if anyone gets a change to kick the tyres/sanity check us, this package is out on NuGet as https://www.nuget.org/packages/Serilog.Extensions.Logging/2.0.0-dev-10164. Cheers!

@gertjvr
Copy link
Contributor Author

gertjvr commented Jul 17, 2017

I am updating the sample project, will push as soon as I get it to build properly

/// logger is not specified but <paramref name="dispose"/> is true, the <see cref="Log.CloseAndFlush()"/> method will be
/// called on the static <see cref="Log"/> class instead.</param>
/// <returns>The logger factory.</returns>
public static IServiceCollection AddSerilog(this IServiceCollection services, Serilog.ILogger logger = null, bool dispose = false)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the new world this extension method should go onto ILoggingBuilder

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pakrym!

@gertjvr I just found the example at: https://github.com/aspnet/Logging/blob/dev/samples/SampleApp/Program.cs#L26

Are you still keen to tinker with this, or should we raise an issue for someone to pick up? Cheers!

@gertjvr
Copy link
Contributor Author

gertjvr commented Jul 17, 2017

Will have a look later today

@gertjvr
Copy link
Contributor Author

gertjvr commented Jul 17, 2017

Maybe raise an issue so we can track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants