Skip to content

Commit

Permalink
Load plugin only when running Xcode. Fix #45.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhua-chen committed Mar 29, 2016
1 parent 5e8eecd commit 5761063
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions MCLog/MCLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ + (void)load {
+ (void)pluginDidLoad:(NSBundle *)bundle {
static id sharedPlugin = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedPlugin = [[self alloc] init];
});

NSString *currentApplicationName = [[NSBundle mainBundle] infoDictionary][@"CFBundleName"];
if ([currentApplicationName isEqual:@"Xcode"]) {
dispatch_once(&onceToken, ^{
sharedPlugin = [[self alloc] init];
});
}
}

+ (NSMutableDictionary<NSString *, MCOrderedMap *> *)consoleItemsMap {
Expand Down

0 comments on commit 5761063

Please sign in to comment.