This repository has been archived by the owner on Jan 25, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4ba42e6
Showing
9 changed files
with
1,256 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// ESConsoleEntry.h | ||
// | ||
// Copyright Doug Russell 2012. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface ESConsoleEntry : NSObject | ||
|
||
@property (nonatomic, retain) NSString *applicationIdentifier; | ||
@property (nonatomic, retain) NSString *message; | ||
@property (nonatomic, retain) NSDate *date; | ||
|
||
@end | ||
|
||
@interface ESConsoleEntry () | ||
@property (nonatomic, retain) NSString *shortMessage; | ||
- (id)initWithDictionary:(NSDictionary *)dictionary; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// | ||
// ESConsoleEntry.m | ||
// | ||
// Copyright Doug Russell 2012. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#import "ESConsoleEntry.h" | ||
#import <asl.h> | ||
#import "ARCLogic.h" | ||
|
||
@implementation ESConsoleEntry | ||
@synthesize message=_message; | ||
@synthesize shortMessage=_shortMessage; | ||
@synthesize applicationIdentifier=_applicationIdentifier; | ||
@synthesize date=_date; | ||
|
||
#pragma mark - | ||
|
||
- (id)initWithDictionary:(NSDictionary *)dictionary | ||
{ | ||
self = [super init]; | ||
if (self != nil) | ||
{ | ||
if (dictionary == nil) | ||
{ | ||
NO_ARC([self release];) | ||
self = nil; | ||
return nil; | ||
} | ||
|
||
self.message = [dictionary objectForKey:[NSString stringWithCString:ASL_KEY_MSG encoding:NSUTF8StringEncoding]]; | ||
if (self.message.length > 200) | ||
self.shortMessage = [self.message substringToIndex:200]; | ||
else | ||
self.shortMessage = self.message; | ||
self.applicationIdentifier = [dictionary objectForKey:[NSString stringWithCString:ASL_KEY_FACILITY encoding:NSUTF8StringEncoding]]; | ||
if (self.applicationIdentifier == nil) | ||
self.applicationIdentifier = [dictionary objectForKey:[NSString stringWithCString:ASL_KEY_SENDER encoding:NSUTF8StringEncoding]]; | ||
self.date = [NSDate dateWithTimeIntervalSince1970:[[dictionary objectForKey:[NSString stringWithCString:ASL_KEY_TIME encoding:NSUTF8StringEncoding]] doubleValue]]; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)dealloc | ||
{ | ||
NO_ARC( | ||
[_message release]; | ||
[_shortMessage release]; | ||
[_applicationIdentifier release]; | ||
[_date release]; | ||
[super dealloc]; | ||
) | ||
} | ||
|
||
#pragma mark - | ||
|
||
- (NSString *)description | ||
{ | ||
return [NSString stringWithFormat:@"Application Identifier: %@\n\nConsole Message: %@\n\nTime: %@", self.applicationIdentifier, self.message, self.date]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// ESDebugConsole+iOS_GUI.h | ||
// | ||
// Copyright Doug Russell 2012. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#import "ESDebugConsole.h" | ||
|
||
@interface ESDebugConsole (iOS_GUI) | ||
|
||
/** | ||
* Gesture recognizer will by default be a rotation gesture recognizer attached to the window | ||
* If you set your own it's target must be [ESDebugConsole sharedDebugConsole] with action gestureRecognized: | ||
*/ | ||
@property (nonatomic, retain) UIGestureRecognizer *gestureRecognizer; | ||
/** | ||
* Used by view controllers when displayed in UIPopoverController | ||
*/ | ||
@property (nonatomic, assign) CGSize consoleSizeInPopover; | ||
|
||
@end | ||
|
||
@interface ESDebugConsole (iOS_GUI_Private) | ||
@property (nonatomic, retain) UIWindow *window; | ||
@property (nonatomic, retain) UIPopoverController *popoverController; | ||
@property (nonatomic, retain) UINavigationController *navigationController; | ||
- (void)iOSInit; | ||
- (void)iOSDealloc; | ||
@end |
Oops, something went wrong.