Skip to content

Add timestamp and message type to the log#4138

Merged
10110111 merged 1 commit into
masterfrom
format-log
Feb 17, 2025
Merged

Add timestamp and message type to the log#4138
10110111 merged 1 commit into
masterfrom
format-log

Conversation

@10110111
Copy link
Copy Markdown
Contributor

This PR adds a timestamp and message type tag to the log output, so that it's easier to find what takes excessive time (e.g. at loading state), as well as to filter by message type (e.g. highlight all warnings, delete all debug messages). After this change the log will look like this:

[    13.921][DBG ] [TelescopeControl] Adding device model: "Meade AutoStar compatible" "Any telescope or telescope mount compatible with Meade's AutoStar controller." "TelescopeServerLx200" 500000
[    13.921][DBG ] [TelescopeControl] Adding device model: "Meade LX200 (compatible)" "Any telescope or telescope mount compatible with Meade LX200." "TelescopeServerLx200" 500000
[    13.921][DBG ] [TelescopeControl] Adding device model: "Meade ETX70 (#494 Autostar, #506 CCS)" "Meade's ETX70 with the #494 Autostar controller and the #506 Connector Cable Set." "TelescopeServerLx200" 1500000
[    13.921][DBG ] [TelescopeControl] Adding device model: "Losmandy G-11" "Losmandy's G-11 telescope mount." "TelescopeServerLx200" 500000
[    13.921][DBG ] [TelescopeControl] Adding device model: "Wildcard Innovations Argo Navis (Meade mode)" "Wildcard Innovations' Argo Navis DTC in Meade LX200 emulation mode." "TelescopeServerLx200" 500000
[    13.921][DBG ] [TelescopeControl] Adding device model: "Celestron NexStar (compatible)" "Any telescope or telescope mount compatible with Celestron NexStar." "TelescopeServerNexStar" 500000
[    13.921][DBG ] [TelescopeControl] Adding device model: "Sky-Watcher SynScan (version 3 or later)" "Any Sky-Watcher mount that uses version 3 or later of the SynScan hand controller." "TelescopeServerNexStar" 500000
[    13.921][DBG ] [TelescopeControl] Adding device model: "Sky-Watcher SynScan AZ GOTO" "The Sky-Watcher SynScan AZ GOTO mount used in a number of telescope models." "TelescopeServerNexStar" 500000
[    13.921][WARN] [TelescopeControl] loadTelescopes(): No telescopes loaded. File is missing: /home/ruslan/.stellarium/modules/TelescopeControl/telescopes.json
[    13.945][DBG ] Loaded plugin "TextUserInterface"
[    14.138][WARN] Dubious result: Landscape  "Guereins"  not calibrated. Opacity test represents mathematical horizon only.
[    14.138][DBG ] OpenGL viewport size: 1920 x 1044
[    14.138][DBG ] Creating scene FBO with size 1920x1044

@github-actions
Copy link
Copy Markdown

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files.

@alex-w
Copy link
Copy Markdown
Member

alex-w commented Feb 17, 2025

Is time process in seconds since start?

@10110111
Copy link
Copy Markdown
Contributor Author

10110111 commented Feb 17, 2025

Is time process in seconds since start?

Yes. I don't think we need system uptime.

@10110111
Copy link
Copy Markdown
Contributor Author

I'll later change the logger's initial printouts (OS name etc.) to also follow the general scheme. Otherwise they are currently printed plainly as before, and don't go to stderr.

@alex-w alex-w added this to the 25.1 milestone Feb 17, 2025
@10110111 10110111 merged commit ad3e849 into master Feb 17, 2025
@10110111 10110111 deleted the format-log branch February 17, 2025 11:21
@10110111
Copy link
Copy Markdown
Contributor Author

From now on there's no need to write "WARNING - something happened". Just "Something happened" is sufficient if it's printed to qWarning().

@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Feb 24, 2025
@github-actions
Copy link
Copy Markdown

Hello @10110111!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Mar 23, 2025
@github-actions
Copy link
Copy Markdown

Hello @10110111!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants