Skip to content

Conversation

@Trouffman
Copy link
Collaborator

This is a Work In Progress.

Goal is to have less but more meaningful log message for the general users and access to finer log in debug for diagnosis & bug reports.

Address mostly : #1193

Set as a Draft PR for now as I need help figuring out why the debug level does not seems to output the desired outcome in the logs.

Settin --distroav-verbose // --distroav-debug do not seems to do anything.

Added more user-friendly Info level logging
@Trouffman Trouffman self-assigned this Mar 20, 2025
@Trouffman Trouffman changed the title Updare all Log Message to be more user-friendly Update all Log Message to be more user-friendly Mar 25, 2025
@Trouffman Trouffman added enhancement Seeking Testers PRs with this label will package the plugin so that others can test labels Mar 28, 2025
@Trouffman
Copy link
Collaborator Author

All ERROR level now have a unique Error Code (to be added in the Wiki).
Warnings should also have some unique Code too (not added yet).

This is also removing the LOG_VERBOSE level in favor of the LOG_DEBUG : Realistically the LOG_VERBOSE was more of a glorified LOG_DEBUG.

The verbose level command line are still valid but will assign the LOG_DEBUG level until we have "cleared" reference to the verbose level from wiki / documentation.

Please test that the LOG_DEBUG entries shows on your system when using the following commands :
--distroav-verbose
--distroav-debug
--distroav-log=verbose
--distroav-log=debug

@BitRate27
Copy link
Contributor

I am not seeing the LOG_DEBUG messages in the log file when I launch OBS with --distroav-debug or --distroav-log=debug.
LOG_DEBUG messages do show up in the Output in the Debugger, regardless of these settings. Only way I can see the LOG_DEBUG messages in DistroAV is by turning on --verbose when launching OBS.

Looking at the code, it seems these command line arguments, specific to DistroAV are only used in the code checking for updates to DistroAV. It also outputs: "config: DistroAV log level set to debug" in the log file.

I like the reformatting and the info, however, if we want to have LOG_DEBUG messages only output for distroAV using the command line args, we need to modify our obs_log to do this:

		if (LOG_LEVEL >= log_level) {
			blogva(0, template, args);
		} else {
			blogva(log_level, template, args);
		}

@Trouffman
Copy link
Collaborator Author

Thanks for pointing this out.

Seems that there are more location where the log can be improved (in the update system for example).

@Trouffman
Copy link
Collaborator Author

Note : this modify the behavior we get fro the obs-template.

I have looked at why we don't follow the same support-pluing.c / .c.in but could not figure it out.

@Palakis or @paulpv I did not found a better way to get this done here.

@Trouffman Trouffman marked this pull request as ready for review April 3, 2025 19:55
@Trouffman Trouffman added this to the 6.1.0 milestone Apr 5, 2025
Copy link
Collaborator Author

@Trouffman Trouffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this we have the Preview Update being called twice (as shown in the log.

This is not blocking for release but should be looked into (possible performance tweak)

13:49:12.244: [distroav] NDI Output Updated. 'OBS-PGM'
13:49:12.247: [distroav] NDI main output started
13:49:12.247: [distroav] NDI Output Updated. 'OBS-PRV'
13:49:12.247: [distroav] NDI Output Updated. 'OBS-PRV'
13:47:56.790: [distroav] +main_output_deinit()
13:47:56.790: [distroav] main_output_deinit: NDI main output is not initialized
13:47:56.790: [distroav] -main_output_deinit()
13:47:56.790: [distroav] main_output_init: creating NDI main output 'OBS-PGM'
13:47:56.790: [distroav] +ndi_output_getdefaults()
13:47:56.790: [distroav] -ndi_output_getdefaults()
13:47:56.790: [distroav] +ndi_output_create(name='OBS-PGM', groups='', ...)
13:47:56.790: [distroav] ndi_output_update(name='OBS-PGM', groups='', ...)
13:47:56.790: [distroav] NDI Output Updated. 'OBS-PGM'
13:47:56.790: [distroav] ndi_output_update(name='OBS-PGM', groups='', uses_video='true', uses_audio='true')
13:47:56.790: [distroav] -ndi_output_create(name='OBS-PGM', groups='', ...)
13:47:56.790: [distroav] main_output_init: created NDI main output 'OBS-PGM'
13:47:56.790: [distroav] +main_output_start()
13:47:56.790: [distroav] main_output_start: starting NDI main output 'OBS-PGM'
13:47:56.790: [distroav] +ndi_output_start(name='OBS-PGM', groups='', ...)
13:47:56.793: [distroav] +on_main_output_started()
13:47:56.793: [distroav] -on_main_output_started()
13:47:56.793: [distroav] NDI main output started
13:47:56.793: [distroav] 'OBS-PGM' ndi_output_start: ndi output started
13:47:56.793: [distroav] -ndi_output_start(name='OBS-PGM', groups=''...)
13:47:56.793: [distroav] main_output_start: successfully started NDI main output 'OBS-PGM'
13:47:56.793: [distroav] -main_output_start()
13:47:56.793: [distroav] -main_output_init()
13:47:56.793: [distroav] +preview_output_init()
13:47:56.793: [distroav] +preview_output_deinit()
13:47:56.793: [distroav] preview_output_deinit: NDI preview output is not initialized. Nothing to deinit.
13:47:56.793: [distroav] -preview_output_deinit()
13:47:56.793: [distroav] preview_output_init: creating NDI Preview Output 'OBS-PRV'
13:47:56.793: [distroav] +ndi_output_getdefaults()
13:47:56.793: [distroav] -ndi_output_getdefaults()
13:47:56.793: [distroav] +ndi_output_create(name='OBS-PRV', groups='', ...)
13:47:56.793: [distroav] ndi_output_update(name='OBS-PRV', groups='', ...)
13:47:56.793: [distroav] NDI Output Updated. 'OBS-PRV'
13:47:56.793: [distroav] ndi_output_update(name='OBS-PRV', groups='', uses_video='true', uses_audio='false')
13:47:56.793: [distroav] -ndi_output_create(name='OBS-PRV', groups='', ...)
13:47:56.793: [distroav] preview_output_init: Successfully created NDI Preview Output 'OBS-PRV'
13:47:56.793: [distroav] +preview_output_start()
13:47:56.793: [distroav] preview_output_start: starting NDI preview output 'OBS-PRV'
13:47:56.793: [distroav] ndi_output_update(name='OBS-PRV', groups='', ...)
13:47:56.793: [distroav] NDI Output Updated. 'OBS-PRV'
13:47:56.793: [distroav] ndi_output_update(name='OBS-PRV', groups='', uses_video='true', uses_audio='false')
13:47:56.793: [distroav] +ndi_output_start(name='OBS-PRV', groups='', ...)
13:47:56.794: [distroav] +on_preview_output_started()
13:47:56.794: [distroav] -on_preview_output_started()
13:47:56.794: [distroav] 'OBS-PRV' ndi_output_start: ndi output started
13:47:56.794: [distroav] -ndi_output_start(name='OBS-PRV', groups=''...)
13:47:56.794: [distroav] preview_output_start: successfully started NDI preview output 'OBS-PRV'
13:47:56.794: [distroav] -preview_output_start()
13:47:56.794: [distroav] -preview_output_init()
13:47:56.855: [distroav] ndi_output_rawaudio('OBS-PGM'): growing audio_conv_buffer from 0 to 8192 bytes
13:47:56.855: [distroav] ndi_output_rawaudio('OBS-PGM'): allocating 8192 bytes```

@BitRate27
Copy link
Contributor

This is happening because we call ndi_output_update within the ndi_output_create callback. I suspect it is not needed. The reason main output doesn't do the same thing is because main output uses obs_output_create instead of obs_register_output. obs_register_output is used for both preview and filter output of NDI.

@Trouffman
Copy link
Collaborator Author

Regarding that last bit of the "Double Preview" start, I think we should look at the preview generating code.

Not something i could find / understand right away.

I have logged an issue #1250 for this purpose and deal with it as part of future improvement.

@BitRate27
Copy link
Contributor

Summary of changes seen: Change back-quote to single-quote, change LOG_INFO to LOG_DEBUG, and override LOG_LEVEL sent to OBS when --distroav-debug set. These work fine.
Only comment I have is the API calls to the webserver report errors under normal conditions and --distroav-debug not set. For example:
12:26:05.171: [distroav] RemoteTextThread: HTTP request failed. { "curlCode":{ "code":22, "text":"HTTP response code said error" }, "error":"The requested URL returned error: 412" }``
If this is failing because I am running on a unreleased version, then it would be nice if it said that. If it is a problem with the webserver, then we should look into it. If it is normal, then we should not report this to the log file as it can be misleading.

@Trouffman
Copy link
Collaborator Author

True the error log from the update system have not been fully re worked.

Will look at them to be more streamlined, but this might be in a different PR more targeted to the update process.

Copy link
Contributor

@BitRate27 BitRate27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we will tackle the update code later, this is fine for now.

@BitRate27 BitRate27 merged commit c99adaa into master Apr 20, 2025
6 checks passed
@BitRate27 BitRate27 deleted the log-messages-rework branch April 20, 2025 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Seeking Testers PRs with this label will package the plugin so that others can test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants