Skip to content

Commit

Permalink
[Event Log] Log ASM flag when modify subnodes #trivial (#379)
Browse files Browse the repository at this point in the history
* Log ASM flag when add subnode

* Log other subnode modifications as well
  • Loading branch information
nguyenhuy authored and maicki committed Jun 22, 2017
1 parent 2dca3e5 commit e264bb7
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions Source/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2006,9 +2006,8 @@ - (void)_insertSubnodeSubviewOrSublayer:(ASDisplayNode *)subnode atIndex:(NSInte

- (void)addSubnode:(ASDisplayNode *)subnode
{
ASDisplayNodeLogEvent(self, @"addSubnode: %@", subnode);
// TODO: 2.0 Conversion: Reenable and fix within product code
//ASDisplayNodeAssert(self.automaticallyManagesSubnodes == NO, @"Attempt to manually add subnode to node with automaticallyManagesSubnodes=YES. Node: %@", subnode);
ASDisplayNodeLogEvent(self, @"addSubnode: %@ with automaticallyManagesSubnodes: %@",
subnode, self.automaticallyManagesSubnodes ? @"YES" : @"NO");
[self _addSubnode:subnode];
}

Expand Down Expand Up @@ -2058,9 +2057,8 @@ - (void)_addSubnodeSubviewOrSublayer:(ASDisplayNode *)subnode

- (void)replaceSubnode:(ASDisplayNode *)oldSubnode withSubnode:(ASDisplayNode *)replacementSubnode
{
ASDisplayNodeLogEvent(self, @"replaceSubnode: %@ withSubnode:%@", oldSubnode, replacementSubnode);
// TODO: 2.0 Conversion: Reenable and fix within product code
//ASDisplayNodeAssert(self.automaticallyManagesSubnodes == NO, @"Attempt to manually replace old node with replacement node to node with automaticallyManagesSubnodes=YES. Old Node: %@, replacement node: %@", oldSubnode, replacementSubnode);
ASDisplayNodeLogEvent(self, @"replaceSubnode: %@ withSubnode: %@ with automaticallyManagesSubnodes: %@",
oldSubnode, replacementSubnode, self.automaticallyManagesSubnodes ? @"YES" : @"NO");
[self _replaceSubnode:oldSubnode withSubnode:replacementSubnode];
}

Expand Down Expand Up @@ -2106,9 +2104,8 @@ - (void)_replaceSubnode:(ASDisplayNode *)oldSubnode withSubnode:(ASDisplayNode *

- (void)insertSubnode:(ASDisplayNode *)subnode belowSubnode:(ASDisplayNode *)below
{
ASDisplayNodeLogEvent(self, @"insertSubnode: %@ belowSubnode:%@", subnode, below);
// TODO: 2.0 Conversion: Reenable and fix within product code
//ASDisplayNodeAssert(self.automaticallyManagesSubnodes == NO, @"Attempt to manually insert subnode to node with automaticallyManagesSubnodes=YES. Node: %@", subnode);
ASDisplayNodeLogEvent(self, @"insertSubnode: %@ belowSubnode: %@ with automaticallyManagesSubnodes: %@",
subnode, below, self.automaticallyManagesSubnodes ? @"YES" : @"NO");
[self _insertSubnode:subnode belowSubnode:below];
}

Expand Down Expand Up @@ -2170,9 +2167,8 @@ - (void)_insertSubnode:(ASDisplayNode *)subnode belowSubnode:(ASDisplayNode *)be

- (void)insertSubnode:(ASDisplayNode *)subnode aboveSubnode:(ASDisplayNode *)above
{
ASDisplayNodeLogEvent(self, @"insertSubnode: %@ abodeSubnode: %@", subnode, above);
// TODO: 2.0 Conversion: Reenable and fix within product code
//ASDisplayNodeAssert(self.automaticallyManagesSubnodes == NO, @"Attempt to manually insert subnode to node with automaticallyManagesSubnodes=YES. Node: %@", subnode);
ASDisplayNodeLogEvent(self, @"insertSubnode: %@ abodeSubnode: %@ with automaticallyManagesSubnodes: %@",
subnode, above, self.automaticallyManagesSubnodes ? @"YES" : @"NO");
[self _insertSubnode:subnode aboveSubnode:above];
}

Expand Down Expand Up @@ -2232,9 +2228,8 @@ - (void)_insertSubnode:(ASDisplayNode *)subnode aboveSubnode:(ASDisplayNode *)ab

- (void)insertSubnode:(ASDisplayNode *)subnode atIndex:(NSInteger)idx
{
ASDisplayNodeLogEvent(self, @"insertSubnode: %@ atIndex: %td", subnode, idx);
// TODO: 2.0 Conversion: Reenable and fix within product code
//ASDisplayNodeAssert(self.automaticallyManagesSubnodes == NO, @"Attempt to manually insert subnode to node with automaticallyManagesSubnodes=YES. Node: %@", subnode);
ASDisplayNodeLogEvent(self, @"insertSubnode: %@ atIndex: %td with automaticallyManagesSubnodes: %@",
subnode, idx, self.automaticallyManagesSubnodes ? @"YES" : @"NO");
[self _insertSubnode:subnode atIndex:idx];
}

Expand Down Expand Up @@ -2295,9 +2290,8 @@ - (void)_removeSubnode:(ASDisplayNode *)subnode

- (void)removeFromSupernode
{
// TODO: 2.0 Conversion: Reenable and fix within product code
//ASDisplayNodeAssert(self.supernode.automaticallyManagesSubnodes == NO, @"Attempt to manually remove subnode from node with automaticallyManagesSubnodes=YES. Node: %@", self);

ASDisplayNodeLogEvent(self, @"removeFromSupernode with automaticallyManagesSubnodes: %@",
self.automaticallyManagesSubnodes ? @"YES" : @"NO");
[self _removeFromSupernode];
}

Expand Down

0 comments on commit e264bb7

Please sign in to comment.