Latest 0.1.0
Homepage https://github.com/yourkarma/KRMLogger
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

Description

KRMLogger is an asynchronous console event logger. KRMLogger supports multiple log sources and log levels. The example project includes an interactive example of using the Logger in your project.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Example

import UIKit
import KRMLogger

class ViewController: UIViewController, ConsoleLoggerDelegate {

    @IBOutlet weak var logLevel: UISegmentedControl!
    @IBOutlet weak var logMessageTextView: UITextView!
    @IBOutlet weak var logRecordTextView: UITextView!

    var logger: KRMLogger?
    let console = Console()

    override func viewDidLoad() {
        super.viewDidLoad()
        self.logger = KRMLogger(name: "com.logger-example.logger", destinations: [self.console])
        self.console.delegate = self
    }

    func consoleLog(msg: String) {
        self.updateLogRecordOnMainThread((self.logRecordTextView?.text ?? "") + "(msg)n")
    }

    func updateLogRecordOnMainThread(text: String) {
        dispatch_async(dispatch_get_main_queue(),{
            self.logRecordTextView?.text = text
        })
    }

    @IBAction func didTapClearLog(sender: AnyObject) {
        self.updateLogRecordOnMainThread("")
    }

    @IBAction func didTapLogEntryButton(sender: AnyObject) {
        self.logger?.log(LogLevel(rawValue: self.logLevel.selectedSegmentIndex)!, self.logMessageTextView.text)
    }

    @IBAction func dismissKeyboard(sender: AnyObject) {
        self.logMessageTextView?.resignFirstResponder()
    }
}

Alt text

Requirements

Installation

KRMLogger is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "KRMLogger"

Author

asowers1, [email protected]

License

KRMLogger is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "KRMLogger",
    "version": "0.1.0",
    "summary": "KRMLogger is an asynchronous console event logger.",
    "description": "KRMLogger is an asynchronous console event logger. KRMLogger supports multiple log sources and log levels. The example project includes an interactive example of using the Logger in your project.",
    "homepage": "https://github.com/yourkarma/KRMLogger",
    "license": "MIT",
    "authors": {
        "asowers1": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yourkarma/KRMLogger.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "KRMLogger/Classes/**/*",
    "resource_bundles": {
        "KRMLogger": [
            "KRMLogger/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This