Yosaku is a log viewer for Cocoa Touch. It depends on CocoaLumberjack.
Yosaku provides YSLogger class as a DDLogger. In the following example, YSLogger is initialized as a property of your application delegate.
#import <YSLogger.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"JST"];
dateFormatter.dateFormat = @"yyyy/MM/dd HH:mm:ss.SSS";
_logger = [[YSLogger alloc] initWithCapacity:100 dateFormatter:dateFormatter];
_logger.updateIntervalSec = 1.5;
[DDLog addLogger:_logger];
return YES;
}Yosaku uses UITableView for displaying log records. You create an empty UITableView and set it to YSLogger.
In the following example, UITableView is set to app.logger in your view controller's viewDidLoad method.
- (void)viewDidLoad
{
[super viewDidLoad];
// _app.logger is a YSLogger
_app = [UIApplication sharedApplication].delegate;
_app.logger.tableView = _logTableView; // YSLogger set myself to tableView's data source and delegate
[_app.logger viewDidLoad];
}
- (void)viewWillDisappear:(BOOL)animated
{
[_app.logger viewWillDisappear:animated];
}
- (void)viewDidAppear:(BOOL)animated
{
[_app.logger viewDidAppear:animated];
}You must call viewDidLoad, viewWillDisappear, and viewDidAppear in your view controller's same name methods for synchronizing YSLogger's life cycle with your view controller's it.
To run the example project, clone the repo, and run pod install from the Example directory first.
- XCode 5.1 or later
- iOS 7 or later
Yosaku is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Yosaku', '~> 0.2.0' # for CocoaLumberjack 2.0.x pod 'Yosaku', '~> 0.1.1' # for CocoaLumberjack 1.9.xShigeru Fujiwara
Yosaku is available under the MIT license. See the LICENSE file for more info.

