Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JimmyPun610/Plugin.XFLogger
Logging library for xamarin forms
https://github.com/JimmyPun610/Plugin.XFLogger
log logger xamarin-forms
Last synced: 30 days ago
JSON representation
Logging library for xamarin forms
- Host: GitHub
- URL: https://github.com/JimmyPun610/Plugin.XFLogger
- Owner: JimmyPun610
- Created: 2019-02-12T03:59:27.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-23T01:55:51.000Z (almost 4 years ago)
- Last Synced: 2024-08-31T14:37:33.386Z (3 months ago)
- Topics: log, logger, xamarin-forms
- Language: C#
- Size: 1.69 MB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-xamarin-forms - Plugin.XFLogger ★3
README
# Plugin.XFLogger
Logging library for xamarin forms, work for iOS and AndroidNuget Url :
https://www.nuget.org/packages/Plugin.XFLogger/
```
Install-Package Plugin.XFLogger
```
Configuration
In MainActiviy.cs (Android)
```C#
base.OnCreate(savedInstanceState);
Plugin.XFLogger.CrossXFLogger.Current.Configure(Plugin.XFLogger.Abstractions.LogTimeOption.DateTimeNow, "applicationLog.log", 3, 1024, Plugin.XFLogger.Abstractions.LogLevel.Info, true);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);```
In / AppDelegate (iOS)
```C#
global::Xamarin.Forms.Forms.Init();
Plugin.XFLogger.CrossXFLogger.Current.Configure(Plugin.XFLogger.Abstractions.LogTimeOption.DateTimeNow, "applicationLog.log", 3, 1024, Plugin.XFLogger.Abstractions.LogLevel.Info, true);
LoadApplication(new App());
```General usage
```C#
public void Info(string message, string tag = "")
{
CrossXFLogger.Current.Info(message, tag);
}public void Debug(string message, string tag = "")
{
CrossXFLogger.Current.Debug(message, tag);
}public void Error(string message, string tag = "")
{
CrossXFLogger.Current.Error(message, tag);
}public void Error(Exception ex, string message, string tag = "")
{
CrossXFLogger.Current.Error(tag, message, ex);
}public void Warn(string message, string tag = "")
{
CrossXFLogger.Current.Warn(message, tag);
}public void Clear()
{
CrossXFLogger.Current.Purge();
}public string GetLog(bool requireReverse = true)
{
return CrossXFLogger.Current.GetAll(requireReverse);
}
```