Latest1.0.3
Homepagehttps://github.com/stv-yokudera/LSSLogger
LicenseMIT
Platformsios 9.0
Authors

A Lightweight and simple Swifty Logger.

Version
Carthage Compatible
License
Platform

Requirements

Swift Version 4.1 or more

Installation

CocoaPods

To integrate LSSLogger into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '9.0'
use_frameworks!

target '<TargetName>' do
    pod "LSSLogger"
end

Then, run the following command:

$ pod install

Carthage

To integrate LSSLogger into your Xcode project using Carthage, specify it in your Cartfile:

github "stv-yokudera/LSSLogger" ~> 1.0

Run carthage update to build the framework and drag the built LSSLogger.framework into your Xcode project.

Setup

By default, whether to output logs is as follows:

LogLevelDEBUGINFOWARNINGERRORFATAL
Output to console
Output to log file×

When you don’t want to output the log in the release build, In AppDelegate, set as follows:

“`swift:AppDelegate.swift
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

#if RELEASE
// For release builds, logs aren't output to the console.
LSSLogger.outputToConsoleEnabled(isEnabled: false)

// For release builds, logs aren't output to the files.
LSSLogger.outputToFileEnabled(isEnabled: false)
#endif

return true

}


And, Active Compilation Conditions is as follows:
<img width="926" alt="2018-05-15 0 23 38" src="https://user-images.githubusercontent.com/25205138/40007027-c19b612e-57d6-11e8-897c-7d5af8431378.png">

## Usage

```swift
import LSSLogger

func debugLogDemo() {
    // Output to the console.
    LSSLogger.console.debug()
    LSSLogger.console.debug(message: "foo")
    LSSLogger.console.info()

    // Output to the file.
    LSSLogger.file.info(message: "bar")
    LSSLogger.file.warning()
    LSSLogger.file.error()
    LSSLogger.file.fatal()

    // Output to the console and file.
    LSSLogger.consoleAndFile.info(message: "foobar")
    LSSLogger.consoleAndFile.warning()
    LSSLogger.consoleAndFile.error()
    LSSLogger.consoleAndFile.fatal()
}

Author

YukiOkudera, [email protected]

License

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

Latest podspec

{
    "name": "LSSLogger",
    "version": "1.0.3",
    "summary": "A Lightweight and simple Swifty Logger.",
    "description": "It can log to the console, the file, or both.",
    "homepage": "https://github.com/stv-yokudera/LSSLogger",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "YukiOkudera": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/stv-yokudera/LSSLogger.git",
        "tag": "1.0.3"
    },
    "source_files": "LSSLogger/*.{h,m,swift}"
}

Pin It on Pinterest

Share This