- You can now add and remove filters and handlers
This commit is contained in:
Tristan B. Velloza Kildaire 2024-04-09 08:34:55 +02:00
parent f6ebb070cc
commit b13621fd82
1 changed files with 52 additions and 0 deletions

View File

@ -72,6 +72,58 @@ public abstract class Logger
this.transforms.linearRemoveElement(transform);
}
// TODO: Handle duplicate?
public final void addFilter(Filter filter)
{
scope(exit)
{
this.lock.unlock();
}
this.lock.lock();
this.filters.insertAfter(this.filters[], filter);
}
// TODO: Hanmdle not found explicitly?
public final void removeFilter(Filter filter)
{
scope(exit)
{
this.lock.unlock();
}
this.lock.lock();
this.filters.linearRemoveElement(filter);
}
// TODO: Handle duplicate?
public final void addHandler(Handler handler)
{
scope(exit)
{
this.lock.unlock();
}
this.lock.lock();
this.handlers.insertAfter(this.handlers[], handler);
}
// TODO: Hanmdle not found explicitly?
public final void removeHandler(Handler handler)
{
scope(exit)
{
this.lock.unlock();
}
this.lock.lock();
this.handlers.linearRemoveElement(handler);
}
// Logs an actual message
//
// This first passes it over all filters