addListener method
Replaces the current LoggingListener with a custom implementation.
Useful if you want to change the output format, destination, or add logic like filtering or buffering logs.
Example:
console.addListener(MyCustomListener());
Implementation
void addListener(LoggingListener listener) {
this.listener = listener;
}