Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elonpark/eplogger
Simple logger
https://github.com/elonpark/eplogger
logger swift
Last synced: 3 months ago
JSON representation
Simple logger
- Host: GitHub
- URL: https://github.com/elonpark/eplogger
- Owner: ElonPark
- License: mit
- Created: 2019-08-29T01:38:03.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2022-05-23T10:26:07.000Z (over 2 years ago)
- Last Synced: 2024-09-19T12:02:09.406Z (4 months ago)
- Topics: logger, swift
- Language: Swift
- Homepage:
- Size: 882 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EPLogger
[![Version](https://img.shields.io/cocoapods/v/EPLogger.svg?style=flat)](https://cocoapods.org/pods/EPLogger)
[![License](https://img.shields.io/cocoapods/l/EPLogger.svg?style=flat)](https://cocoapods.org/pods/EPLogger)
[![Platform](https://img.shields.io/cocoapods/p/EPLogger.svg?style=flat)](https://cocoapods.org/pods/EPLogger)## Use
1. `import EPLogger` in your `AppDelegate.swift`
2. copy & paste `public typealias Log = EPLogger.Log` into your `AppDelegate.swift` to top
3. Set Log level in to `AppDelegate.didFinishLaunchingWithOptions` method
4. Done!more detail, see [Example](./Example/EPLogger/ViewController.swift)
## Example
```swiftimport UIKit
import EPLogger// If you want to get import once and use it globally
public typealias Log = EPLogger.Log@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Set log level. default is verbose
Log.config(level: .verbose)
Log.verbose("This is verbose")
Log.debug("This is debug")
Log.info("This is info")
Log.warning("This is warning")
Log.error("This is error")return true
)
}
```
It will print like this
## Requirements
Swift 5.0
## Installation
EPLogger is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'EPLogger'
```
Also, Support Carthage too
simply add the following line to your Cartfile:
```ruby
github "ElonPark/EPLogger"
```## Author
Elon Park, [email protected]
## License
EPLogger is available under the MIT license. See the LICENSE file for more info.