Code Monkey home page Code Monkey logo

Comments (5)

nicolaiw avatar nicolaiw commented on June 11, 2024

I think that is not necessary. Serilog already has many sinks and is therefore very flexible. I think we should not reinvent the wheel here. However, I would offer the caller the possibility to pass a logger configuration which is currently hardcoded in CCZnp.Init().

from zigbeenet.

eiaro avatar eiaro commented on June 11, 2024

LibLog is made for the purpose.

from zigbeenet.

nicolaiw avatar nicolaiw commented on June 11, 2024

I just had a look at LibLog and it seems to be exactly what we are looking for.

@Mr-Markus do you agree ?

from zigbeenet.

nicolaiw avatar nicolaiw commented on June 11, 2024
using System;
using Serilog;

namespace` ZigbeeNet.PlayGround
{
    class Program
    {
        static void Main(string[] args)
        {
            // Configure Serilog
            Log.Logger = new LoggerConfiguration()
               .MinimumLevel.Debug()
               .WriteTo.Console()
               .CreateLogger();

            try
            {
                var zigbeeService = new ZigbeeService(new Options { Baudrate = 115200, Port = "COM3" });
                zigbeeService.Start();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            Console.ReadLine();
        }
    }
}

will now produce something like:

unbenannt

I removed all dependencies of Serilog and instead added LibLog. (@eiaro thanks for your advice). Now the user of the lib can decide which framework to use or even write a custom logger.

@Mr-Markus something happend that should not :) .. I unintentionally pulled directly to the project instead of sending a pull request. Sry for that! To avoid this in the future pls remove me as a contributor so that I can't pull directly to this repo.

from zigbeenet.

Mr-Markus avatar Mr-Markus commented on June 11, 2024

Yes, exactly what we were looking for!

Thanks for Suggestion @eiaro and thanks to @nicolaiw for implementation

@nicolaiw
Ok, i would remove you from the collaborator list and you can create pullrequests for your changes :)

Because of that i will close the issue. Thanks!

from zigbeenet.

Related Issues (20)

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.