BindOpen is a framework that enables the development of highly extensible applications. It allows you to enhance your .NET projects with custom script functions, connectors, entities, and tasks.
BindOpen.Logging offers a simple and multidimensional logging system, perfect to monitor nested task executions.
This repository contains the BindOpen.Logging code source.
A full list of all the BindOpen.Kernel repos is available as well.
To get started, install the BindOpen.Logging module you want to use.
Note: We recommend that later on, you install only the package you need.
Module | Instruction |
---|---|
BindOpen.Logging | PM> Install-Package BindOpen.Logging |
Module | Instruction |
---|---|
BindOpen.Logging | > dotnet add package BindOpen.Logging |
...
var log = BdoLogging.NewLog().WithTitle("A test log");
TestMethodA(-1, log);
if (log.HasErrors()) { Debug.Console(String.Format("Errors found ({0})", log.ToString())); }
...
private void TestMethodA(int num, IBdoLog log = null)
{
if (num>0) { log?.AddWarning("Number should be negative"); return; }
...
var subLog = log.InsertChild(BdoLogging.NewLog().WithTitle("Sub test log"));
TestMethodA1("B" + num, subLog);
}
private void TestMethodA1(string st, IBdoLog log = null)
{
if (st?.StartsWith("A") != true) { log?.InsertError("String must start with 'A'").WithResultCode("500"); return; }
...
}
var logger = BdoLogging.NewLogger<BdoTraceLogger>();
var log = logger.NewRootLog();
log.AddCheckpoint("Checkpoint A");
logger.Log(log);
// Example with Serilog
Log.Logger = new LoggerConfiguration()
.Enrich.FromLogContext()
.WriteTo.Console()
.WriteTo.File(_filePath_serilog, rollingInterval: RollingInterval.Day)
.CreateLogger();
var loggerFactory = new LoggerFactory();
loggerFactory.AddSerilog(Log.Logger);
var logger = BdoLogging.NewLogger(loggerFactory);
var log = BdoLogging.NewLog();
log.AddCheckpoint("Checkpoint A");
logger.Log(log);
This project is licensed under the terms of the MIT license. See LICENSE.
This BindOpen.Logging module contains the following Nuget packages:
Package | Provision |
---|---|
BindOpen.Logging.Abstractions | Interfaces and enumerations |
BindOpen.Logging | Core package |
BindOpen.Logging.IO | Serialization / Deserialization |
BindOpen.Logging.IO.Dtos | Data transfer classes |
The atomicity of these packages allows you install only what you need respecting your solution's architecture.
All of our NuGet packages are available from our NuGet.org profile page.
BindOpen.Kernel provides the core packages of BindOpen.
BindOpen.Hosting enables you to integrate a BindOpen agent within the .NET service builder.
BindOpen.Labs is a collection of projects based on BindOpen.
A full list of all the repos is available as well.
The BindOpen Docs are the ideal place to start if you are new to BindOpen. They are categorized in 3 broader topics:
- Articles to learn how to use BindOpen;
- Notes to follow our releases;
- Api to have an overview of BindOpen APIs.
The BindOpen Blog is where we announce new features, write engineering blog posts, demonstrate proof-of-concepts and features under development.
If you're having trouble with BindOpen, file a bug on the BindOpen Issue Tracker.
You are welcome to support this project. All donations are optional but are greatly appreciated.