LogSheet
Features
This is my agenda for this repository,
- Maintain a CSV File which maintain your logs
- Export CSV File using UIActivityViewController
- UI ListView which shows all logs with a detail view.
- Filter Button where, you can filter logs on LogType.
- Update/Delete Option
Installation
LogSheet is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'LogSheet'
Usage
- Initialize
import LogSheet
Then, you need a LogSheet object for futher actions,
let logSheet = LogSheet.instance
- Create Log
At any point, you want to create a log then call write(_:) method which expects LogModel() Object.
// Structure Your Log Model
let model = LogModel(identifer: 123, name: "New Error ", description: "This is my Error. I should write a detailed explanation", tags: [.buisnessError], type: .verbose, createTimestamp: Date(), updateTimestamp: Date())
// Call Write method to persist
if logSheet.write(log: model) {
print("Successfully Written")
}
else {
print("Failed while writing")
}
- Read Log
There is a read method which expect LogID if you want to get that particlaur log. Else, You have to pass nil in the parameter.
// All Logs
if let data = logSheet.read(nil) {
print("Logs Count: \(data.cout)")
}
// Any Particular Log
if let data = logSheet.read(123) {
print(data.description)
}
Author
Abhishek Kumar Ravi, [email protected]
License
LogSheet is available under the MIT license. See the LICENSE file for more info.