Logkit alternatives and similar libraries
Based on the "Logging" category.
Alternatively, view Logkit alternatives based on common mentions on social networks and blogs.
-
CocoaLumberjack
A fast & simple, yet powerful & flexible logging framework for macOS, iOS, tvOS and watchOS -
XCGLogger
A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number. -
GodEye
Automaticly display Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code based on Swift. Just like God opened his eyes -
TinyConsole
📱💬🚦 TinyConsole is a micro-console that can help you log and display information inside an iOS application, where having a connection to a development computer is not possible. -
CleanroomLogger
CleanroomLogger provides an extensible Swift-based logging API that is simple, lightweight and performant -
KZLinkedConsole
Clickable links in your Xcode console, so you never wonder which class logged the message. -
Diagnostics
Allow users to easily share Diagnostics with your support team to improve the flow of fixing bugs. -
JustLog
JustLog brings logging on iOS to the next level. It supports console, file and remote Logstash logging via TCP socket with no effort. Support for logz.io available. -
LxDBAnything
Automate box any value! Print log without any format control symbol! Change debug habit thoroughly! -
XLFacility
Elegant and extensive logging facility for OS X & iOS (includes database, Telnet and HTTP servers) -
Twitter Logging Service
Twitter Logging Service is a robust and performant logging framework for iOS clients -
Loggerithm
A lightweight Swift logger, uses print in development and NSLog in production. Support colourful and formatted output. -
Atlantis
A powerful input-agnostic swift logging framework made to speed up development with maximum readability. -
CleanroomASL
A Swift-based API for reading from & writing to the Apple System Log (more commonly known somewhat inaccurately as "the console") -
TraceLog
TraceLog is a highly configurable, flexible, portable, and simple to use debug logging system for Swift and Objective-C applications running on Linux, macOS, iOS, watchOS, and tvOS. -
ReflectedStringConvertible
A protocol that allows any class to be printed as if it were a struct or a JSON object. -
Spy
Spy is a flexible, lightweight, multiplatform logging utility written in pure Swift. It allows to log with different levels and on different channels. You can define what levels and channels actually are.
InfluxDB - Power Real-Time Data Analytics at Scale
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Logkit or a related project?
README
LogKit
LogKit is a logging framework built to be simple to get started with, efficient to execute, safe for shipping code, and extensible for flexibility. It is written in pure Swift and is suitable for OS X, iOS, tvOS, and watchOS application logging. For a developer looking for more power than print()
, LogKit takes just a moment to get started with, and comes ready to log to the console, a file, an HTTP service, or all three. Need to log to somewhere else? Defining your own Endpoint is easy too.
This readme contains just a few tips to get you started with LogKit. To learn everything else, check the project website.
Contents
Features
- [x] Simple setup
- [x] Comprehensive documentation
- [x] Built-in Console, File, and HTTP Endpoints
- [x] Priority-filtering per Endpoint
- [x] Complete Log Entry format customization per Endpoint
- [x] Custom Endpoints via simple protocol conformance
Requirements
- Project targeting OS X 10.9+, iOS 7+, tvOS 9+, or watchOS 2+
- Xcode 7.3 and Swift 2.2
Installation
There are a few ways to install LogKit. Below are some tips, but for full details, see the installation guide.
Note: For some reason, CocoaPods removes the CocoaPods and Carthage installation instructions from this readme displayed on their website. Please visit the installation guide if you do not see these installation options.
CocoaPods
Supports iOS 8+, OS X 10.9+, tvOS 9+, watchOS 2+
Include LogKit in your Podfile:
use_frameworks!
pod 'LogKit', '~> 2.3'
For more information on getting started with CocoaPods, read the guide.
Carthage
Supports iOS 8+, OS X 10.9+, tvOS 9+, watchOS 2+
Include LogKit in your Cartfile:
github "logkit/logkit" ~> 2.3
For more information on getting started with Carthage, visit the repo.
Embedded Framework
Supports iOS 8+, OS X 10.9+, tvOS 9+, watchOS 2+
Include LogKit.xcodeproj
within your project (second level, below your project root, as a sub-project). Select your target, and add LogKit as an Embedded Binary in the General tab. Pick the appropriate LogKit framework for your target’s OS. Be sure to select the framework, not the tests.
Source
Supports iOS 7+, OS X 10.9+, tvOS 9+, watchOS 2+
Integrating the LogKit source is the only way to include LogKit in projects targeting iOS 7. When this installation method is used, skip the
import LogKit
.
Add all of the .swift
files found in the Sources
directory to your project. No other steps are necessary for installation.
Migrating from LogKit 1
If you have previously used LogKit 1, most of LogKit 2 will be familiar to you. However, many objects have updated names and initializers. Please review the ChangeLog and read the Migration Guide to update your code for LogKit 2.
Usage
LogKit is easy to get started with. Everything comes with convenience initializers that require the bare minimum arguments (usually no arguments) and provide sensible defaults. Get started quickly, and then customize as desired later.
Use the Quick Start below to get started now, then check out the usage guide for details of everything LogKit can do.
Quick Start
Near the top of your AppDelegate.swift
file, add the following two lines:
import LogKit
let log = LXLogger()
This will import the LogKit framework and create a global Logger instance. This Logger will initialize with a standard Console Endpoint set to log all messages in the default format. Since the Logger instance is created in the global scope, you should only create it once (AppDelegate.swift
is the best place).
You can now log from anywhere in your project:
log.info("Hello Internet!")
// 2015-06-25 07:36:01.638000 [INFO] applicationDidFinishLaunching <AppDelegate.swift:23> Hello Internet!
Now you're logging! You can use the debug
, info
, notice
, warning
, error
, and critical
Logger methods.
Additional Endpoints
If you wanted to log to a file as well as the console, and you wanted the file to only receive notice
and higher Log Entries, you could set your logger up like this:
import LogKit
let log = LXLogger(endpoints: [
LXConsoleEndpoint(),
LXFileEndpoint(
fileURL: NSURL(string: /* Path to your log file */),
minimumPriorityLevel: .Notice
),
])
You can add and configure as many Endpoints as desired, such as the included File and HTTP Service Endpoints. You can also completely customize the format in which Log Entries are written to each Endpoint.
Formatting
Each Endpoint has a property named dateFormatter
that controls how an Entry's dateTime
property will be formatted. It accepts an LXDateFormatter
instance and is usually set at initialization time.
let log = LXLogger(endpoints: [
LXConsoleEndpoint(
dateFormatter = LXDateFormatter(formatString: "HH:mm:ss.SSS")
),
])
Each Endpoint also has a property named entryFormatter
that controls how an Entry will be converted to a string for output. It accepts an LXEntryFormatter
instance and is also usually set at initialization time.
let log = LXLogger(endpoints: [
LXConsoleEndpoint(
entryFormatter = LXEntryFormatter({ entry in
return "\(entry.dateTime) [\(entry.level.uppercaseString)] \(entry.message)"
})
),
])
See the Entry Formatting documentation for more details on formatting, available Log Entry properties, and LXEntryFormatter
.
Contributing
LogKit welcomes contributions! Please see CONTRIBUTING.md for more info.
License
LogKit is licensed under the permissive ISC License.
*Note that all licence references and agreements mentioned in the Logkit README section above
are relevant to that project's source code only.