Skip to content

Instantly share code, notes, and snippets.

@markd2
Last active February 25, 2017 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markd2/4b3be16abbe692bdd8b8461b80a07ac1 to your computer and use it in GitHub Desktop.
Save markd2/4b3be16abbe692bdd8b8461b80a07ac1 to your computer and use it in GitHub Desktop.
#import "ViewController.h"
#import <os/activity.h>
#import <os/log.h>
@interface ViewController ()
@end // extension
static os_activity_t g_appActivity;
@implementation ViewController
+ (void) load {
[super load];
} // load
- (void) viewDidLoad {
[super viewDidLoad];
// Tried putting these in +load too
g_appActivity = os_activity_create("appActivity",
OS_ACTIVITY_CURRENT,
OS_ACTIVITY_FLAG_DEFAULT);
assert(g_appActivity);
} // viewDidLoad
- (void) ook {
os_log(OS_LOG_DEFAULT, "I fall upon the thorns of life! I skin my knees!");
os_activity_label_useraction("knees");
os_trace("knees1");
NSLog(@"BORK");
assert(!"die");
} // ook
- (IBAction) thing1 {
os_activity_scope(g_appActivity);
os_activity_label_useraction("verb");
os_trace("verb1");
os_log(OS_LOG_DEFAULT, "I seem to be a verb");
} // thing1
- (IBAction) thing2 {
os_activity_scope(g_appActivity);
os_activity_label_useraction("pez");
os_trace("pez1");
os_log(OS_LOG_DEFAULT, "I smell like Pez");
[self ook];
} // thing2
@end // ViewController
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment