jdholtz / auto-southwest-check-in

A Python script that automatically checks in to your Southwest flight 24 hours beforehand.
GNU General Public License v3.0
463 stars 89 forks source link

log to stdout #271

Closed Kampe closed 4 months ago

Kampe commented 5 months ago

Description

log directories are not useful in kubernetes installations typically, please just log to stdout

What alternatives have you considered?

forking

jdholtz commented 5 months ago

Could you clarify a bit more about your reasoning for this feature request?

Logs can be written to stdout using the -v or --verbose flag in the CLI

log directories are not useful in kubernetes installations typically, please just log to stdout

The log directory can be made persistent with a Persistent Volume (or something similar). However, there are many users that don't run this script in Kubernetes and there have been many cases where the log directory has come in handy (e.g. the user filed an issue but didn't run the script with the --verbose flag. The logs can still be retrieved in the logs directory). Therefore, I don't see a reason for removing a feature that has proved itself helpful and has no effect on users that run this script using Kubernetes.

Kampe commented 5 months ago

I think there are useful situations for logging to a file for sure, however, by default it seems a bit heavy-handed. The script can be very simple, however, it has dependencies on the operating system as it currently sits. Typically people like to run containers on secure environments without any kind of permissions on the operating system, specifically the ability to write to disk.

jdholtz commented 5 months ago

Typically people like to run containers on secure environments without any kind of permissions on the operating system, specifically the ability to write to disk.

That's a valid point. I could make a flag to disable it (e.g. --disable-log-file) but I wouldn't want to make it not write to the logs directory by default.

Another thing to note is that the log files are not the only files written to disk when running the script. The downloaded_files folder holds the driver lock (managed by SeleniumBase), the __pycache__ directory, and probably temporary files created by Chromium. There's probably workarounds for some of these, but not logging to a file would not remove all writes to the disk made when running this script.

jdholtz commented 5 months ago

Hey @Kampe any comments on my response above? Want to clarify if this feature is necessary (or should be implemented at all).

Kampe commented 5 months ago

I think that's a great solution!

jdholtz commented 5 months ago

@Kampe do you think an option like this would even be necessary though? Per my comment above, not writing logs to a file would not prevent all writes to disk by the script (it would still need write permissions). Therefore, I don’t think this would solve your original intention of not needing write permissions in Kubernetes.

Kampe commented 5 months ago

Having logs through standard out is typically how I consume logs and I would bet others as well. Temporary files are not really a concern here but I was just making a point, there are ways around this to allow it.

jdholtz commented 5 months ago

It’s simple to implement, but I want to make sure people can benefit from it too. Could you clarify what the flag would be helpful for (not writing to a log file)? You can print the logs to stdout already with the --verbose flag.

Kampe commented 4 months ago

--log-to-stdout maybe? Something along those lines.

However if verbose forces logs to stdout my request is resolved :)

jdholtz commented 4 months ago

However if verbose forces logs to stdout my request is resolved :)

Yes, running the script with -v or --verbose will write the logs to stdout in addition to the file.

jdholtz commented 4 months ago

Closing this as the request seems to be solved with the verbose flag.