Swell alternatives and similar libraries
Based on the "Logging" category.
Alternatively, view Swell alternatives based on common mentions on social networks and blogs.
-
SwiftyBeaver
Convenient & secure logging during development & release in Swift 4 & 5 -
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. -
Dotzu
Debbuger tool for iOS developer. Display logs, network request, device informations, crash logs while using the app. -
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 -
Willow
Willow is a powerful, yet lightweight logging library written in Swift. -
WatchdogInspector
Shows your current framerate (fps) in the status bar of your iOS app -
Duration
A simple Swift package for measuring and reporting the time taken for operations -
Atlantis
A powerful input-agnostic swift logging framework made to speed up development with maximum readability. -
Puree
[Obsoleted] A log collector for iOS (new version! -> https://github.com/cookpad/Puree-Swift) -
AEConsole
Customizable Console UI overlay with debug log on top of your iOS App -
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. -
AELog
Simple, lightweight and flexible debug logging framework written in Swift
Appwrite - The Open Source Firebase alternative introduces iOS support
* 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 Swell or a related project?
Popular Comparisons
README
Swell - Swift Logging
A logging utility for Swift and Objective C.
Features
- Turn on logging during development, turn them off when building for the App Store
- Enable or disable logging for specific classes
- Different log levels allow for finer-grained control of logging within a class
- Log to the console, text file, or a custom location
- Log message isn't computed when logging is disabled (thanks to the @auto_closure feature)
Maintenance Note
I actively use this for my own projects, and every new project I create includes this. It works well for my needs. However, I develop iOS apps only in my spare time, which is not a lot. This can affect my response time to pull requests.
Basic Usage
Using the shared logger
The shared logger is the simplest, quickest way to get started using Swell.
class ContactService {
func getContact(name: String) {
Swell.info("Retrieving contact for \(name)")
...
}
}
INFO: Retrieving contact for Steve
Using a named logger
Using a named logger allows for better control over which logs of which classes you want to see during development. A typical name would match the class using it, making it easy to see which class is logging which statement.
class ContactService {
let logger = Swell.getLogger("ContactService")
func getContact(name: String) {
logger.debug("Retrieving contact for \(name)")
...
}
}
DEBUG ContactService: Retrieving contact for Steve
Logging complex statements
Sometimes you need extra code in order to generate the information you need to log, but you don't need to execute the same code when you build for the App Store. Using Swell's closure functions is the answer to this scenario.
class ContactService {
let logger = Swell.getLogger("ContactService")
func getContact(name: String) {
...
logger.trace {
let city = getCityFor(name)
return "Retrieving contact for \(name) of \(city)"
}
...
}
}
The code in the closure will only execute if the statement will be logged according to how the Logger is configured.
Disable all loggers
Are you building for the App Store? Don't forget to disable your loggers.
Swell.disableLogging()
See also the next section, which uses an optional .plist
file to configure Swell.
Configuration
For more control over how Swell loggers behave, add a Swell.plist resource file. You can then configure which log levels to enable, where to send the log output, and what information to include for each log.
Root configuration
The root configuration specifies the behavior for all Swell loggers.
[Swell.plist
example](Documentation/plist01.png "Swell.plist")
All keys are optional. However, if you specify "file" for the log location, you should provide a filename for the log file. Any unspecified values will revert to built-in defaults.
Named logger configurations
You can specify a different configuration for named loggers. As with the root configuration, the configuration details are optional, and any unspecified values will use what the root configuration has for it.
In the plist
file, create a Dictionary type, and use the logger name as the Key. The configuration in this Dictionary will be used for that logger.
[Swell.plist
with configuration for a named logger](Documentation/plist02.png "Swell.plist with configuration for a named logger")
In the example above, MyStableClass is configured to only produce logs that are error level or higher, and will use a different log output format than other loggers. Since a log location wasn't provided, it will use the same location specified in the root configuration.
To use this logger, specify its name when you create your Logger instance.
let logger = Swell.getLogger("MyStableClass")
Roadmap
Let's be honest - we have a long list of features for anything we write, long before we're done writing them.
However, my goal is to keep Swell as simple as possible, while allowing the configurability I've been looking for since I started iOS development.
So here's list of To Do for Swell:
- More documentation
- Improved Date format in FlexFormatter
That said, the Swell library is alpha software. Things may change (drastically). However, I'm already using it extensively for my projects, so I have plenty of incentives to keep the public API stable.