Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any logging framework for Portable Class Library?

Is there any logging framework which supports Portable Class Library? I searched on Nuget but failed to find any.

Thanks,

like image 972
Dodd Avatar asked Jan 04 '13 04:01

Dodd


3 Answers

Not sure, if there is logging framework targeting directly Portable Class Library, but nothing stops you from implementing logging in your PCL using Dependency Injection - create interface for logging service and implement it in all target platforms separately using your favorite, or even different libraries. You have then more control over specific logging settings - it's quite different approach for logging in .NET WPF app, WP8 app or Windows Store app.

like image 57
Martin Suchan Avatar answered Dec 03 '22 10:12

Martin Suchan


I'll answer my own question:

Common.Logging, a widely-used portable logging abstraction for .NET, became PCL compatible in early 2014 (around version 2.2.0). I used Common.Logging in most of my libraries (PCL and non-PCL) and it just works perfectly.

like image 22
Dodd Avatar answered Dec 03 '22 11:12

Dodd


Check out Splat.

A library to make things cross-platform that should be

It's a small PCL library with some useful cross-platform classes including logging...

https://github.com/paulcbetts/splat/blob/master/Splat/Logging.cs

You can get it from NuGet.

like image 34
Tim Avatar answered Dec 03 '22 10:12

Tim