示例#1
0
        /// <summary>
        /// Publish a <see cref="RxLogEntry"/> to the host.
        /// </summary>
        /// <param name="entry"></param>
        public void Publish(RxLogEntry entry)
        {
            Guard.NotNull(entry);

            if (Enabled)
            {
                LogHost.Publish(entry);
            }
        }
示例#2
0
        /// <summary>
        /// Publish a lost entry using the specified meta and instance data.
        /// </summary>
        /// <param name="meta"></param>
        /// <param name="instance"></param>
        /// <returns></returns>
        public static RxLogEntry Log(RxLogEntryMeta meta, object instance)
        {
            Guard.NotNull(instance);

            var entry = new RxLogEntry(meta, instance);

            Log(entry);

            return(entry);
        }
示例#3
0
        /// <summary>
        /// Create and publish a log entry with specified <see cref="RxLogEntryMeta"/> and instance data.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="meta"></param>
        /// <param name="instance"></param>
        /// <returns></returns>
        public static RxLogEntry <T> Log <T>(RxLogEntryMeta meta, T instance)
        {
            Guard.NotNull(instance);

            var entry = new RxLogEntry <T>(meta, instance);

            Log(entry);

            return(entry);
        }
示例#4
0
        public static RxLogEntry Log(this object publisher, object instance, [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int lineNo = 0)
        {
            Guard.NotNull(publisher);

            var meta  = RxLog.CreateMeta(publisher.GetType(), callerMemberName, lineNo);
            var entry = new RxLogEntry(meta, instance);

            RxLog.Log(entry);

            return(entry);
        }
示例#5
0
 /// <summary>
 /// Internal method to enqueue a message
 /// </summary>
 /// <param name="entry"></param>
 internal void Enqueue(RxLogEntry entry)
 {
     _syncsubject.OnNext(entry);
 }
示例#6
0
 /// <summary>
 /// Public a <see cref="RxLog"/> to subscribers.
 /// </summary>
 /// <param name="entry"></param>
 public void Publish(RxLogEntry entry)
 {
     _pumpSubject.OnNext(entry);
 }
示例#7
0
        /// <summary>
        /// Log an entry to the default log writer.
        /// </summary>
        /// <param name="entry"></param>
        public static void Log(RxLogEntry entry)
        {
            Guard.NotNull(entry);

            Default?.Publish(entry);
        }