Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
利辺羅エルネスト committed Nov 14, 2013
1 parent 8008c81 commit 42033f6
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 14 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}
Copyright 2013 Ernesto Rivera

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
9 changes: 4 additions & 5 deletions LumberjackConsole.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ Pod::Spec.new do |s|
s.homepage = "http://ptez.github.io/LumberjackConsole"

s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
s.author = { "Ernesto Rivera" => "[email protected]" }
s.screenshots = [ "https://raw.github.com/wiki/CyberAgent/iOS-NBUCore/images/Dashboard.png",
"https://raw.github.com/wiki/CyberAgent/iOS-NBUCore/images/Dashboard_minimized.png",
"https://raw.github.com/wiki/CyberAgent/iOS-NBUCore/images/Dashboard_filter.png" ]
s.author = { "Ernesto Rivera" => "[email protected]" }
s.screenshots = [ "http://ptez.github.io/LumberjackConsole/images/screenshot1.png",
"http://ptez.github.io/LumberjackConsole/images/screenshot2.png" ]
s.source = { :git => "https://github.com/PTEz/LumberjackConsole.git", :tag => "#{s.version}" }

s.platform = :ios
s.requires_arc = true
s.preserve_paths = "README.*", "NOTICE", "*.xcconfig"
s.preserve_paths = "README.md", "NOTICE"

s.dependency 'NBUCore', '>= 2.0.0'
s.dependency 'CocoaLumberjack', '>= 1.6.3'
Expand Down
17 changes: 17 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

LumberjackConsole
Copyright 2013 Ernesto Rivera.


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.

88 changes: 87 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,90 @@

LumberjackConsole
=================

An on-device CocoaLumberjack console.
[![Platform: iOS](https://cocoapod-badges.herokuapp.com/p/LumberjackConsole/badge.svg)](http://cocoadocs.org/docsets/LumberjackConsole/)
[![Version: 1.0.0](https://cocoapod-badges.herokuapp.com/v/LumberjackConsole/badge.png)](http://cocoadocs.org/docsets/LumberjackConsole/)
[![Build Status](https://travis-ci.org/PTEz/LumberjackConsole.png?branch=master)](https://travis-ci.org/PTEz/LumberjackConsole)

On-device CocoaLumberjack console with support for search, filters and more.

![Screenshot 1](http://ptez.github.io/LumberjackConsole/images/screenshot1.png) ![Screenshot 2](http://ptez.github.io/LumberjackConsole/images/screenshot2.png)

### Installation

Simply add `pod 'LumberjackConsole'` to your [CocoaPods](http://cocoapods.org)' [Podfile](http://docs.cocoapods.org/podfile.html).

### Usage

#### a) Dashboard Logger

Import the dashboard header:
```obj-c
#import <LumberjackConsole/PTEDashboard.h>
```

Add its logger for testing builds:
```obj-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#ifndef MY_PRODUCTION_MACRO
// Add the console dashboard for testing builds
[DDLog addLogger:[PTEDashboard sharedDashboard].logger]; // <- If not using NBULog
// [NBULog addDashboardLogger]; // <- If using NBULog
DDLogInfo(@"Added console dashboard");
#endif
// ...
return YES;
}
```

#### b) Embeded Console

You can also embed the console into your own `UITableView`:

```obj-c
// Add a custom console
_customConsoleLogger = [PTEConsoleLogger new];
_customConsoleLogger.tableView = self.customConsoleTableView;
[DDLog addLogger:_customConsoleLogger];

DDLogInfo(@"Added a custom console logger");
```
### More
When coupled with [NBULog](https://github.com/CyberAgent/iOS-NBULog) you can dynamically adjust log levels from within the dashboard!
![Screenshot 3](http://ptez.github.io/LumberjackConsole/images/screenshot3.png)
You log level settings are saved to `NSUserDefaults`.
### Documentation
http://cocoadocs.org/docsets/LumberjackConsole/
### ToDo
* Clean up table view's data source.
* Improve rotation support.
* Clear log and message markers.
* Long tap to copy text.
* Read crash reports.
### License
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.
9 changes: 9 additions & 0 deletions Source/Adjust Levels/PTEAdjustLevelsTableView.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,27 @@
//

/**
A table view used to dynamically adjust log levels.
@note Enabled only when NBULog is present.
*/
@interface PTEAdjustLevelsTableView : UITableView

@end


/**
An adjust levels' cell.
*/
@interface PTEAdjustLevelsCell : UITableViewCell

/// The name of the log module.
@property (weak, nonatomic) IBOutlet UILabel * nameLabel;

/// The current log level.
@property (weak, nonatomic) IBOutlet UILabel * levelLabel;

/// A stepper to increase/decrease the log level.
@property (weak, nonatomic) IBOutlet UIStepper * levelStepper;

@end
Expand Down
3 changes: 2 additions & 1 deletion Source/PTEConsoleLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
- Can be filtered according to log levels or text.
- Can be minimized, maximized or used in any size in between.
@note You don't need to use this class directly but instead use [NBULog addDashboardLogger].
@note You don't need to use this class directly but instead use
[DDLog addLogger:[PTEDashboard sharedDashboard].logger] or [NBULog addDashboardLogger].
*/
@interface PTEConsoleLogger : DDAbstractLogger <UITableViewDelegate,
UITableViewDataSource,
Expand Down
16 changes: 11 additions & 5 deletions Source/PTEDashboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// LumberjackConsole
//
// Created by Ernesto Rivera on 2012/12/17.
// Copyright (c) 2012-2013 CyberAgent Inc.
// Copyright (c) 2013.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -21,11 +21,10 @@
#import "PTEConsoleLogger.h"

/**
An on-device "dashboard" to display (for now):
On-device Dashboard to display a PTEConsoleLogger.
- A PTEConsoleLogger.
@note You don't need to use this class directly but instead use [NBULog addDashboardLogger].
@note You don't need to use this class directly but instead use
[DDLog addLogger:[PTEDashboard sharedDashboard].logger] or [NBULog addDashboardLogger].
*/
@interface PTEDashboard : UIWindow

Expand All @@ -44,14 +43,21 @@
/// A button to toggle: the dashboard size.
@property (weak, nonatomic) IBOutlet UIButton * toggleButton;

/// Views that should be hidden when not in fullscreen mode.
@property (strong, nonatomic) IBOutletCollection(UIView) NSArray * fullscreenOnlyViews;

/// The view that has the console.
@property (strong, nonatomic) IBOutlet UIView * loggerView;

/// The view that has the adjust levels' controls.
@property (strong, nonatomic) IBOutlet UIView * adjustLevelsView;

/// Maximize/minimize the log dashboard.
/// @param sender The sender object.
- (IBAction)toggleFullscreen:(id)sender;

/// Toggle between the loggerView and the adjustLevelsView.
/// @param sender The sender object.
- (IBAction)toggleAdjustLevelsView:(id)sender;

/// @name Properties
Expand Down
2 changes: 1 addition & 1 deletion Source/PTEDashboard.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// LumberjackConsole
//
// Created by Ernesto Rivera on 2012/12/17.
// Copyright (c) 2012-2013 CyberAgent Inc.
// Copyright (c) 2013.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 42033f6

Please sign in to comment.