glennake / DirectFire_Converter

DirectFire Firewall Converter - Network Security, Next-Generation Firewall Configuration Conversion, Firewall Syntax Translation and Firewall Migration Tool - supports Cisco ASA, Fortinet FortiGate (FortiOS), Juniper SRX (JunOS), SSG / Netscreen (ScreenOS) and WatchGuard (support for further devices in development). Similar to FortiConverter, SmartMove, Expedition etc.
GNU General Public License v3.0
50 stars 17 forks source link

Hi, no need to merge this PR, it's just for direct messages :) #5

Closed andy-landy closed 3 years ago

andy-landy commented 3 years ago

Hi, I want to keep traceback-with-variables as convenient as possible, so I collect feedback from its users :) It looks like a pull request is the only way to communicate on github though. If you feel like spending a minute to leave a couple sentences, I'd appreciate.

Would it be more convenient if anything was implemented in some different way? Are there any missing features? Maybe it needs more examples (e.g. it seems, that decorated def main would be more appropriate than overloaded sys.excepthook since it does the same but logging code resides at one place)?

glennake commented 3 years ago

Hi @andy-landy, thanks for the message. The functionality works well, I did struggle a little with implementation and understanding the docs, but that may be down to my Python skill level. How would a decorator on the main function be implemented? Thanks, Glenn

glennake commented 3 years ago

Would it be using @prints_exc decorator on main function?

andy-landy commented 3 years ago

I added some examples, e.g. with a decorator https://github.com/andy-landy/traceback_with_variables/blob/master/examples/print_for_function.py

You can just move it to main as well:

@prints_exc
def main():...

or

@prints_exc(fmt=Format(...), file_=...)
def main():...

to customize the output and/or where to print it

But if you need just the simplest solution and there's only 1 process and 1 thread, and you're fine with all defaults, you can just add from traceback_with_variables import activate_by_import in the beginning and that will be the only line related to this lib in the code.

I feel I need to make some better overview in the readme, yeah I feel it too ;) The thing is I cannot create a text that would differ from sort of printing out all examples one-by-one, but I'll try some time next month.

glennake commented 3 years ago

Thanks @andy-landy for the further info and use cases, will give them a go and hopefully reduce and simplify my code

glennake commented 3 years ago

Updates work great, thanks @andy-landy