Giter Site home page Giter Site logo

chillisource.mobile.logging's Introduction

License: MIT Built With C#

ChilliSource.Mobile.Logging

This project is part of the ChilliSource framework developed by BlueChilli.

Summary

This library provides a Raygun logging sink and Serilog based logging extensions and helper classes to simplify the instantiation and usage of Serilog logging functionality.

Usage

Initialization

You need to first create a LoggerConfiguration instance and specify the type of logging sink that receives the logged data. Currently ChilliSource.Mobile.Logging only provides a Raygun sink, however you can add additional sinks if you wish.

var config = new LoggerConfiguration()
    .MinimumLevel.Verbose()
    .WriteTo.Raygun("RaygunAPIKey");

Then create the logger from the configuration:

ILogger logger = config.BuildLogger();

Logging

You can now use the logger to capture errors, warnings, information, and debugging data:

logger?.Error(ex, message);
logger?.Warning(message);
logger?.Information(message);
logger?.Debug(message);

Logging within ChilliSource.Mobile

The ChilliSource.Mobile frameworks perform their own logging using the ILogger interface (available in ChilliSource.Mobile.Core).

In order to let the frameworks log their data, simply create a new logger as outlined above and pass it as a parameter to one of the relevant methods or constructors.

For example, to use Raygun logging for the BeaconService in ChilliSource.Mobile.IoT.Beacons framework, write the following code:

var logger = new LoggerConfiguration()
    .MinimumLevel.Verbose()
    .WriteTo.Raygun("RaygunAPIKey")
    .BuildLogger();

var beaconService = DependencyService.Get<IBeaconService>();    
beaconService.InitializeService(BeaconMonitoringType.RegionMonitoring, logger);

Installation

The library is available via NuGet here.

Releases

See the releases.

Contribution

Please see the Contribution Guide.

License

ChilliSource.Mobile is licensed under the MIT license.

Feedback and Contact

For questions or feedback, please contact [email protected].

chillisource.mobile.logging's People

Contributors

onikiri2007 avatar buildsrv avatar valiantv7 avatar

Watchers

Mick Rippon avatar Mitch Malone avatar James Cloos avatar Sebastien Eckersley-Maslin avatar  avatar  avatar  avatar Jeremy avatar  avatar Ting avatar  avatar  avatar

Forkers

onikiri2007

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.