Introduction
Welcome to the Puree documentation! Puree is a powerful logging library for iOS applications. This documentation will guide you through the installation process, help you understand the features offered by Puree, and assist you in integrating and using Puree in your iOS projects.
Installation
To install Puree in your iOS project, you can utilize either Cocoapods or Swift Package Manager (SPM).
Cocoapods
To install Puree using Cocoapods, add the following line to your Podfile:
pod 'Puree'
Then, run the command pod install
to install the Puree library.
Swift Package Manager (SPM)
To install Puree using Swift Package Manager, follow these steps:
- Click on “File” in Xcode.
- Select “Swift Packages” and then “Add Package Dependency”.
- Enter the Puree repository URL:
https://github.com/cookpad/Puree-Swift.git
. - Choose a version rule according to your preference and add the package to your project.
Usage
Once you have installed Puree in your project, you can start logging events using PureeLogger. The basic steps to use Puree in your project are:
- Import Puree in your source file:
import Puree
- Create a PureeConfiguration and configure log streams:
- Create a PureeLogger instance:
- Log your events:
let configuration = PureeConfiguration
.jsonConfiguration("my_configuration", logStore: logStore)
.addFilter(MyFilter())
.addOutput(MyOutput())
Replace MyFilter
and MyOutput
with your own filter and output classes.
let logger = PureeLogger(configuration: configuration)
logger.log(["event_key": "event_data"])
Advanced Configuration
Puree offers several advanced configuration options. These options include configuring custom log stores, filters, and outputs, as well as setting a log level and configuring the number of log retries. For detailed information on advanced configuration, please refer to the Puree GitHub repository.
Conclusion
Congratulations! You have successfully installed and integrated Puree into your iOS project. You can now log events using PureeLogger and take advantage of its powerful logging capabilities. Make sure to explore the advanced configuration options to customize Puree according to your specific requirements. If you have any further questions or need assistance, don’t hesitate to reach out to the Puree community or refer to the official Puree documentation.