Page 1 of 1

Here's a utility to analyze SharpCap's Log

Posted: Mon Apr 24, 2023 6:15 pm
by jackg
I find the log very useful to understand what happens during a session. But there's so much stuff in it it's hard to get the goodies that are important to an imager, rather than to someone troubleshooting the code or what not. So I wrote a little Python program that extracts the goodies from the log. You can get a copy for free here: http://www.ganssle.com/jack/astro.html - look for the title on that page "SharpCap Log Processor". Enjoy!

Here's an example of the output:
sc_log.jpg
sc_log.jpg (91.92 KiB) Viewed 3677 times

Re: Here's a utility to analyze SharpCap's Log

Posted: Mon Apr 24, 2023 10:00 pm
by Menno555
This indeed looks very useful.
But could you describe how to use? I have just a very little bit of Python knowledge. I tried to use it but get errors that are gibberish for me :)
I presume this can be used for the normal log files as well?

Menno

Re: Here's a utility to analyze SharpCap's Log

Posted: Tue Apr 25, 2023 10:41 am
by jackg
You have to install Python on your computer and be sure you can access it from whatever directory you're using this utility in. (That depends on your OS).

Then enter this command:

parse_sharpcap_log.py log_file

So, for instance, Sharpcap's log files have long names. I'll rename the one I want to use something like "log1.log". Then I enter:

parse_sharpcap_log.py log1.log

This will generate a file named log1.log_parsed.txt, which you can examine with any text editor, like notepad.

Jack

Re: Here's a utility to analyze SharpCap's Log

Posted: Tue Apr 25, 2023 12:20 pm
by Menno555
Okay, I was on the right path then.
I have Python 3.11.3 installed on my system (Windows 11). I open Windows Powershell in the log directory where your script also is in.
In Powershell I enter Python and Python is running. I tested it with print("Hello, world!") and that does work with no errors.
But when I use parse_sharpcap_log.py log1.log (I renamed a log to that), I get this error:

Code: Select all

>>> parse_sharpcap_log.py log1.log
  File "<stdin>", line 1
    parse_sharpcap_log.py log1.log
                          ^^^^
SyntaxError: invalid syntax
>>>
Menno

Re: Here's a utility to analyze SharpCap's Log

Posted: Tue Apr 25, 2023 12:39 pm
by jackg
You are running the Python interpreter, and then invoking the program. I have never run the interpreter like that so don't know much about it.

I run the program from the DOS command prompt. So I tell Windows to run "cmd", which opens a DOS window, then change directories to where my program (parse_sharpcap_log.py) and log file are. Then, from the DOS command prompt ('>'), run it. This is a screen shot:
cmd_line.jpg
cmd_line.jpg (14.15 KiB) Viewed 3636 times
What is happening is that the CMD window sees a file with the extension ".py" and it runs the program under Python.

Jack

Re: Here's a utility to analyze SharpCap's Log

Posted: Tue Apr 25, 2023 3:05 pm
by Menno555
Thanks for the info Jack. Thought I had to run in in that Python interpreter.
Did run it in Powershell with .\parse_sharpcap_log.py log2.log and now it works (with Powershell you have to add .\ at the start of the line).
But your script really is for sequencer logs I see now. Which is logical I realize now since the normal logs for instance have no line numbers or timed events.
But cool nevertheless and I got an extra basic training with Python :)

Menno

Re: Here's a utility to analyze SharpCap's Log

Posted: Tue Apr 25, 2023 5:04 pm
by admin
Hi,

that looks very cool - thanks for sharing.

I also find the log can be difficult to find specific things in at times, but almost all of the info comes in handy from time to time when tracking down bugs or whatever. I use a freeware program called 'Tailviewer' which is quite good for finding particular things in the log (like finding all the lines that mention guiding or whatever). I have a plugin for it that helps it interpret the log correctly - I am away at the moment, but will try to dig out and share the plug in when I get back.

cheers,

Robin

Re: Here's a utility to analyze SharpCap's Log

Posted: Wed Apr 26, 2023 3:27 pm
by kaymann
Visual Studio Code (free) is also a great notepad replacement and does all the above. I use VSC as a complete replacement for notepad and default it for *.log, *.ini, *txt, *CSV, *.PDF, etc. You can definitely use it with custom filters to include/exclude segments of your log files.

Having said that I love to create and or borrow python and other C code to enhance my computing life. Jack this is awesome work!

Randall

Re: Here's a utility to analyze SharpCap's Log

Posted: Mon Mar 23, 2026 9:14 pm
by Eric.H45
Hi Jack.

Where can I found "SharpCap Log Processor" ? I can't find it following the link you provide.

Best regards
Eric H.