Logging & Port handling

foxesden <foxesden.av63pb-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]> Fri, 9 Dec 2022 13:24:56 +0000
Newsgroups gmane.music.equipment.slimdevices.devel
Organization Logitech Squeezebox Forums
Message-ID <[email protected]>
In my never-ending quest to bring the DSP plugins up-to-date <Irony/>

I would like to understand a bit more about log-handling and ports
within the squeeze infrastructure.

Logging
The helper has its own log, but it is not in anyway integrated into the
server. I have found the UPNP-Bridge quite helpful to look at, and I can
see 2 entries in the plugin script

$prefs->init({ 
	autorun => 1, opts => '', 
	debugs => '', 
	logging => 0, 
	bin => undef, 
	configfile => "upnpbridge.xml", 
	profilesURL => initProfilesURL(), 
	autosave => 1, 
	eraselog => 0,
	baseport => '',
});
my $log = Slim::Utils::Log->addLogCategory({
	'category'     => 'plugin.upnpbridge',
	'defaultLevel' => 'WARN',
	'description'  => Slim::Utils::Strings::string('PLUGIN_UPNPBRIDGE'),
}); 

can you explain what the logging => 0, setting does?
and what are the benefits of the second statement starting - my $log =
Slim::Utils::Log->addLogCategory({

Does this give the capability of viewing the log from within the
settings page? and will it handle housekeeping the log size?

If that is not complicated enough - my second question relates to
sockets and ports.

I am thinking of switching the helper binary to a 3rd party binary as
this ticks all the boxes feature-wise, whilst also being a smaller and
faster binary. I have been speaking to the developer of this and he
tells me that I can make the binary behave dynamically by allocating a
port and communicating that way. To do this properly means I would need
to identify an unused port for each instance that is running, and assign
this when a player starts. Is there anything in the slimserver codebase
that would assist in doing this, either port allocation or storage?

As always any help or pointers greatly appreciated.


------------------------------------------------------------------------
foxesden's Profile: http://forums.slimdevices.com/member.php?userid=56286
View this thread: http://forums.slimdevices.com/showthread.php?t=117192