Description
LumberjackConsole is a powerful logging tool for iOS or macOS applications. It provides an easy way to log messages during app development and debugging.
Features
- Convenient logging to the console
- Customizable log levels (verbose, debug, info, warning, error)
- Flexible formatting options
- Support for different log destinations (console, file, email, etc.)
- Support for logging network requests and responses
- Integration with other logging frameworks (CocoaLumberjack, SwiftyBeaver, etc.)
Installation
To install LumberjackConsole in your project, follow these steps:
- Open your project in Xcode
- Go to “File” > “Swift Packages” > “Add Package Dependency…”
- Enter the package repository URL: https://github.com/XYZ/lumberjackconsole
- Select the desired version
- Click “Next”
- Choose the target where you want to add the package
- Click “Finish”
Usage
To start using LumberjackConsole in your code, import the module:
// Swift
import LumberjackConsole
// Objective-C
@import LumberjackConsole;
Then, configure the logger and start logging messages:
// Configure logger
LumberjackConsole.shared.logLevel = .debug
LumberjackConsole.shared.logDestination = .console
// Log messages
LumberjackConsole.shared.log(.info, "This is an info message")
LumberjackConsole.shared.log(.error, "An error occurred: \(error.localizedDescription)")
Advanced Configuration
For advanced configuration options, you can modify the following properties of the shared LumberjackConsole
instance:
logLevel
: Sets the minimum log level to displaylogDestination
: Sets the log destination (console, file, etc.)logFormatter
: Sets the log message formatternetworkLoggingEnabled
: Enables or disables logging network requests and responses
Resources
For more information on using LumberjackConsole, refer to the following resources: