Latest 0.2.1
Homepage https://github.com/matteocrippa/Debug
License MIT
Platforms ios 8.0, tvos 9.0
Dependencies AlamofireRouter
Authors

CI Status
Version
License
Platform

Example

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

Troubleshooting

If you are ain debug mode and logs aren’t shown, set in your Swift Compiler – Custom Flags -Other Flags, only for DEBUG, a flag like -DDEBUG

Usage

Import the lib using:

import Debug

then use print function normally, but prepend Debug like this:

Debug.print('Hello world!')

Debug support also remote logging, clone Debug-Remote and start the server.

Then add this simple (extra row) in your AppDelegate:

Debug.set(remoteURI: "http://")

Set your remote log url according the one provided by the server.

IMPORTANT Each time you restart the server you will get a new url, pay attention in updating the url in your app before starting.

Then update your Info.plist file adding this entry:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localtunnel.me</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>

Installation

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

pod "Debug"

then add after end this few rows to manage DEBUG flags

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == 'Debug'
            target.build_configurations.each do |config|
                if config.name == 'Debug'
                    config.build_settings['OTHER_SWIFT_FLAGS'] = '-DDEBUG'
                else
                    config.build_settings['OTHER_SWIFT_FLAGS'] = ''
                end
            end
        end
    end
end

Author

Matteo Crippa, @ghego20

License

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

Latest podspec

{
    "name": "Debug",
    "version": "0.2.1",
    "summary": "A swift print that works only in debug mode",
    "description": "Debug print for swift, automatically mute the print in RELEASE mode.",
    "homepage": "https://github.com/matteocrippa/Debug",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Matteo Crippa": ""
    },
    "source": {
        "git": "https://github.com/matteocrippa/Debug.git",
        "tag": "0.2.1"
    },
    "social_media_url": "https://twitter.com/ghego20",
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0"
    },
    "source_files": "Debug/Classes/**/*",
    "dependencies": {
        "AlamofireRouter": [
            "~> 0.1"
        ]
    }
}

Pin It on Pinterest

Share This