Overhaul our logging, add activity tracing support. (#399)

* Improve the os_log and os_activity integration

* Address feedback from Scott and Huy
This commit is contained in:
Adlai Holler
2017-07-03 19:03:26 -07:00
committed by GitHub
parent 2cda73a334
commit 8ec4b312cf
44 changed files with 707 additions and 265 deletions

View File

@@ -16,6 +16,8 @@
//
#import <AsyncDisplayKit/ASNavigationController.h>
#import <AsyncDisplayKit/ASLog.h>
#import <AsyncDisplayKit/ASObjectDescriptionHelpers.h>
@implementation ASNavigationController
{
@@ -65,39 +67,53 @@ ASVisibilityDepthImplementation;
- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated
{
as_activity_create_for_scope("Pop multiple from ASNavigationController");
NSArray *viewControllers = [super popToViewController:viewController animated:animated];
as_log_info(ASNodeLog(), "Popped %@ to %@, removing %@", self, viewController, ASGetDescriptionValueString(viewControllers));
[self visibilityDepthDidChange];
return viewControllers;
}
- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated
{
as_activity_create_for_scope("Pop to root of ASNavigationController");
NSArray *viewControllers = [super popToRootViewControllerAnimated:animated];
as_log_info(ASNodeLog(), "Popped view controllers %@ from %@", ASGetDescriptionValueString(viewControllers), self);
[self visibilityDepthDidChange];
return viewControllers;
}
- (void)setViewControllers:(NSArray *)viewControllers
{
// NOTE: As of now this method calls through to setViewControllers:animated: so no need to log/activity here.
[super setViewControllers:viewControllers];
[self visibilityDepthDidChange];
}
- (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated
{
as_activity_create_for_scope("Set view controllers of ASNavigationController");
as_log_info(ASNodeLog(), "Set view controllers of %@ to %@ animated: %d", self, ASGetDescriptionValueString(viewControllers), animated);
[super setViewControllers:viewControllers animated:animated];
[self visibilityDepthDidChange];
}
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
as_activity_create_for_scope("Push view controller on ASNavigationController");
as_log_info(ASNodeLog(), "Pushing %@ onto %@", viewController, self);
[super pushViewController:viewController animated:animated];
[self visibilityDepthDidChange];
}
- (UIViewController *)popViewControllerAnimated:(BOOL)animated
{
as_activity_create_for_scope("Pop view controller from ASNavigationController");
UIViewController *viewController = [super popViewControllerAnimated:animated];
as_log_info(ASNodeLog(), "Popped %@ from %@", viewController, self);
[self visibilityDepthDidChange];
return viewController;
}