using System; using System.Collections.Generic; using System.Text; using UnityEngine; namespace UniRx.Diagnostics { public class ObservableLogger : IObservable { static readonly Subject logPublisher = new Subject(); public static readonly ObservableLogger Listener = new ObservableLogger(); private ObservableLogger() { } public static Action RegisterLogger(Logger logger) { if (logger.Name == null) throw new ArgumentNullException("logger.Name is null"); return logPublisher.OnNext; } public IDisposable Subscribe(IObserver observer) { return logPublisher.Subscribe(observer); } } }