コード例 #1
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------
        public void AppendLogNode(LogNode node)
        {
            var currentLog = _anchor.CurrentThreadLog;

            if ( currentLog != null )
            {
                currentLog.AppendNode(node);
            }
            else
            {
                using ( var unknownThreadActivity = new FormattedActivityLogNode(UnknownThreadMessageId, "???") )
                {
                    StartThreadLogNoCheck(ThreadTaskType.Unspecified, unknownThreadActivity);
                    _anchor.CurrentThreadLog.AppendNode(node);
                }
            }

            _plainLog.LogNode(node);

            //if ( node.Level >= LogLevel.Warning )
            //{
            //    PlainLog.LogNode(node);
            //}
        }
コード例 #2
0
ファイル: ActivityLogNode.cs プロジェクト: votrongdao/NWheels
        //-----------------------------------------------------------------------------------------------------------------------------------------------------
        internal virtual void AppendChildNode(LogNode child, bool clearFailure = false)
        {
            if ( _isClosed )
            {
                throw new InvalidOperationException("Cannot append log node to a closed activity.");
            }

            base.BubbleLogLevelFrom(child.Level.NoFailureIf(clearFailure));
            base.BubbleContentTypesFrom(child.ContentTypes);

            if ( !clearFailure )
            {
                BubbleExceptionFrom(child.Exception);
            }

            if ( _lastChild != null )
            {
                _lastChild.AttachNextSibling(child);
            }

            _lastChild = child;

            if ( _firstChild == null )
            {
                _firstChild = child;
            }
        }
コード例 #3
0
ファイル: ThreadLogTests.cs プロジェクト: votrongdao/NWheels
        //-----------------------------------------------------------------------------------------------------------------------------------------------------
        private void AppendNodeTestString(LogNode node, StringBuilder output)
        {
            output.Append(node is ActivityLogNode ? "A" : "L");
            output.Append(node.Level.ToString().Substring(0, 1));

            if ( node.Exception != null )
            {
                output.Append("X");
            }

            output.Append(":");
            output.Append(node.SingleLineText);
        }
コード例 #4
0
ファイル: ThreadLog.cs プロジェクト: votrongdao/NWheels
        //-----------------------------------------------------------------------------------------------------------------------------------------------------
        public void AppendNode(LogNode node, bool clearFailure = false)
        {
            node.AttachToThreadLog(this, _currentActivity);
            _currentActivity.AppendChildNode(node, clearFailure);

            var nodeAsActivity = (node as ActivityLogNode);

            if ( nodeAsActivity != null )
            {
                _currentActivity = nodeAsActivity;
            }
        }
コード例 #5
0
 //-----------------------------------------------------------------------------------------------------------------------------------------------------
 public void AppendLogNode(LogNode node)
 {
     _logNodes.Add(node);
     node.AttachToThreadLog(_threadLog, parent: null);
 }
コード例 #6
0
ファイル: LogNode.cs プロジェクト: votrongdao/NWheels
 //-----------------------------------------------------------------------------------------------------------------------------------------------------
 internal void AttachNextSibling(LogNode sibling)
 {
     if ( _nextSibling == null )
     {
         _nextSibling = sibling;
     }
     else
     {
         throw new InvalidOperationException("This log node already has attached sibling node");
     }
 }