code: public static void addListener(String name, LogEventListener listener) {
      Map<String, LogEventListener> threadListeners = listeners.get();
      if (threadListeners == null) {
        threadListeners = new HashMap<>();
      }
  
      threadListeners.put(name, listener);
      listeners.set(threadListeners);
    }
docs: Add a listener (to the current thread).
  @param name unique name of this listener (per thread).
  Can be used later to remove listener using method {@link #removeListener(String)}
  @param listener event listener