A debug log framework for Swift that adds context like date, function, filename, and line number to console and file logs.
XCGLogger is a debug log framework for Swift projects that enhances basic logging with contextual information like timestamps, function names, filenames, and line numbers. It solves the problem of Swift lacking a C preprocessor, which prevents the use of traditional debug log macros from Objective-C, by providing a feature-rich alternative to `NSLog()` or `print()`.
Swift developers building applications for iOS, macOS, tvOS, or watchOS who need structured, configurable logging for debugging and monitoring.
Developers choose XCGLogger for its deep integration with Swift, extensive customization options, and performance features like selective execution and background processing, making it a robust and flexible logging solution compared to basic alternatives.
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.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Appends date, function name, filename, and line number to every log message, transforming simple prints into detailed debug traces as shown in the example log output.
Uses closures to defer log message construction until necessary, preventing performance waste when logs are suppressed by level, a feature highlighted in the Selective Executing Code section.
Supports multiple destinations like console and files, custom filters by file or tag, and ANSI color formatting for terminals, allowing fine-grained control over log presentation.
Includes log rotation by size or time and archiving via AutoRotatingFileDestination, making it suitable for long-running applications in production environments.
Lacks official support for Linux and Objective-C, as noted in the To Do list, restricting use in cross-platform or mixed-language projects.
The experimental UserInfoHelpers for tagging logs have acknowledged issues, such as cumbersome single-tag usage and problems with set merging, making them unreliable for production.
Setting up custom destinations, filters, and formatters requires significant code and understanding of the advanced usage patterns, which can be daunting for quick implementations.