Simple logging library for iOS written in Swift
Swift Package Manager
Once Swift package set up, add the following to your
dependencies: [ .package(url: "https://github.com/nakkht/logr.git", exact: "0.5.0") ]
To add Logr to your project using Carthage, add the following to your
github "nakkht/logr" "0.5.0"
To integrate using CocoaPods, install CocoaPods and include the following in your
pod 'Logr', '~> 0.5.0'
AppDelegate.swift file add:
At the beginning of
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool configure logr service with wanted targets:
LogrService.init(with: Config(ConsoleTarget(), FileTarget()))
For more serious configuration in production, it is recommended to ommit `ConsoleTarget'. The following snippet is suggested:
#if DEBUG static let targets: [Target] = [ConsoleTarget(), FileTarget()] #else static let targets: [Target] = [FileTarget()] #endif static let config = Config(targets: targets) LogrService.init(with: config)
Demo project can be access by opening Demo.workspace in Demo subfolder.
- Documentation generated with jazzy. Hosted by GitHub Pages.
- Architecture document available in project wiki
This repository is under the Apache v2.0 license. Find it here.
Copyright 2020 Paulius Gudonis 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.
You may find interesting
v0.5.0 - 2020-03-20 19:56:08
- Interactive demo
- More documentation
- Tag for
v0.4.0 - 2019-11-13 22:42:58
- Carthage support
v0.3.4 - 2019-11-12 13:15:27
- Creating archive folder if does not exist
v0.3.3 - 2019-11-12 11:58:44
- Archive folder created as file instead of folder
v0.3.2 - 2019-11-12 11:36:35
- Documentation for public apis
- Dispatch queue configuration for file target
- Using wrong url for deleting/renaming archived files
v0.3.1 - 2019-11-11 13:18:09
- Message struct
- More tests for FileTargetConfig
- Access modifiers for ConsoleTargetConfig/FileTargetConfig/Config initialisers
v0.3.0 - 2019-10-16 21:37:48
- Swift Package Manager support
- Setting maxArchivedFilesCount in FileTargetConfig
v0.2.0 - 2019-09-17 21:44:48
- Logging to a file (FileTarget)
- Config option to set your own dispatch queue
- Log levels per target config
v0.1.0 - 2019-08-20 21:57:29
- Main logging mechanism
- Target concept
- ConsoleTarget for logging to console