mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user