Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Logging

Robin Gabriël edited this page Jan 24, 2020 · 1 revision

Application wide logging is provided via a logger class that implements IChromelyLogger. Chromely provides a default, simple logging class - SimpleLogger. This can be replaced by a different logger, but the logger must implement - IChromelyLogger.

Example of a custom logger

using Chromely.Core;

namespace My_Chromely_App
{
    class Program
    {
        static void Main(string[] args)
        {
            // basic example of the application builder
            AppBuilder
            .Create()
            .UseLogger<CustomLogger>()
            .UseApp<DemoChromelyApp>()
            .Build()
            .Run(args);
        }
    }
}
using Chromely;
using Chromely.Core;

namespace My_Chromely_App
{
    class CustomLogger : IChromelyLogger
    {
        public void Critial(string message)
        {
            throw new NotImplementedException();
        }

        public void Debug(string message)
        {
            throw new NotImplementedException();
        }

        public void Error(string message)
        {
            throw new NotImplementedException();
        }

        public void Error(Exception exception)
        {
            throw new NotImplementedException();
        }

        public void Error(Exception exception, string message)
        {
            throw new NotImplementedException();
        }

        public void Fatal(string message)
        {
            throw new NotImplementedException();
        }

        public void Info(string message)
        {
            throw new NotImplementedException();
        }

        public void Verbose(string message)
        {
            throw new NotImplementedException();
        }

        public void Warn(string message)
        {
            throw new NotImplementedException();
        }
    }
}