powertab / powertabeditor

View and edit guitar tablature.
https://powertab.github.io
GNU General Public License v3.0
533 stars 68 forks source link

Add logging #331

Open psyomn opened 3 years ago

psyomn commented 3 years ago

Description of Change(s)

Adds a very primitive and simple way to log stuff. Currently I see we don't use a lot of qDebug and friends, but maybe we can leverage around this in the future, if we need to debug some sort of weird behavior.

Feel free to request any sort of changes -- I'd like to keep the style and thoughts as close to the rest of the repo, and I feel I may have overlooked something.

Thanks!

Fixes Issue(s)

N/A

check logs exist on:

cameronwhite commented 3 years ago

I think the additions look good so far! My main comment would be that we might want some logging in parts of the codebase that don't have a Qt dependency (e.g. looking for existing usage of std::cerr) so perhaps some of this should be split out and moved into a lower level library like Util? There also is a boost logging library, but that's probably overkill for what we need :)

psyomn commented 3 years ago

Ah good point! I'll check that out, and poke you again for a check, thanks!

luzpaz commented 10 months ago

Any traction here ?

psyomn commented 10 months ago

Considering holidays are coming, it might be a nice time to resume my work on here. Possibly end of month, I'll give another jab at this.

On Tue, Dec 05, 2023 at 08:14:56AM -0800, luzpaz wrote:

Any traction here ?

-- Reply to this email directly or view it on GitHub: https://github.com/powertab/powertabeditor/pull/331#issuecomment-1841118706 You are receiving this because you authored the thread.

Message ID: @.***>

psyomn commented 9 months ago

Windows: so I'm getting radio silence from logs on windows, and I don't get it. I'm guessing stdout/stderr don't emit like in sane, normal, programming environments too, so I really can't gauge where exactly the fail is happening. I've read here and there that on Windows GUI programs can actually mute these unless you > them to files (but that didn't work either). I'll revisit this next weekend and see what's up.

Linux works fine.

cameronwhite commented 9 months ago

Yeah I think that's probably the expected behaviour and is kinda tricky to change: e.g. https://stackoverflow.com/questions/3360548/console-output-in-a-qt-gui-app

IIRC, with qDebug() the behaviour was the same, but the logs did show up in the Visual Studio debugger. I think it might be using a Windows API like OutputDebugString()

psyomn commented 9 months ago

Ah, I was merely complaining that cout was not available as a fallback; but that doesn't allow me to figure out why the log file is not being created currently (I checked the paths, and APPDATA in theory should've had this file). This will be something I'll take a look at next weekend.

On Sun, Jan 07, 2024 at 06:56:10PM -0800, Cameron White wrote:

Yeah I think that's probably the expected behaviour and is kinda tricky to change: e.g. https://stackoverflow.com/questions/3360548/console-output-in-a-qt-gui-app

IIRC, with qDebug() the behaviour was the same, but the logs did show up in the Visual Studio debugger. I think it might be using a Windows API like OutputDebugString()

-- Reply to this email directly or view it on GitHub: https://github.com/powertab/powertabeditor/pull/331#issuecomment-1880320605 You are receiving this because you authored the thread.

Message ID: @.***>