kean / Pulse

Network logger for Apple platforms
https://pulselogger.com
MIT License
6.32k stars 302 forks source link

Share pulse package via email #197

Closed ristkof closed 1 year ago

ristkof commented 1 year ago

I am trying to add a zip file of a pulse package store.pulse to an email.

My best attempt at the moment is to use Pulse.LoggerStore.shared.copy to make a file and add that to the mail.

This seems to be an sqlite file with in it two keys: info and database, of which database is an lzfse-compressed sqlite file.

This is workable, but I would have loved that the email contains a zipped .pulse file. Am I overlooking an easier way to do this?

kean commented 1 year ago

Hey @ristkof,

Pulse supports two file formats:

The export(...) method introduced in one of the latest versions supports both of these formats.

In Pulse 2.0, the archives were created by simply zipping the package. Unfortunately, I had to rely on an external dependency for that. In Pulse 3.0, I started using SQLite as a document format.

This is workable, but I would have loved that the email contains a zipped .pulse file. Am I overlooking an easier way to do this?

Is there a particular reason you want to go with zip? The current SQLite-based document type is already optimized for sharing as it's a single file.

The main disadvantage I can think of is that there is no easy way to open the actual logs database using a third-party tool for viewing the SQLite databases. That's a shame, and I would love to address that, but I'm not sure how it can be done without re-introducing the dependency. I could add an export feature to the upcoming Pulse for Mac that would allow you to get direct access to the underlying logs database.

ristkof commented 1 year ago

Thanks for your reply. As I am not using async yet in this project I will stick with the copy method.

The reason I thought of zip is that I saw that the .pulse files are actually packages, and to share that over email I automatically think of zip. No other reason.

I think the easiest way to help my scenario would be if PulseUI had an import functionality for the pulse file, much as described in your blogpost.

But for now, the code in that blogpost seems sufficient, and I can get by with this.

Thanks for your time!