Announcement
Collapse
No announcement yet.
Logging & Port handling
Collapse
X
-
Logging & Port handling
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.
Leave a comment:
-
Logging & Port handling
> can you explain what the logging => 0, setting does?
That's something plugin specific. Without looking at what exactly it
does I'd say it has nothing to do with the LMS logging infrastructure.
> and what are the benefits of the second statement starting - my $log =
> Slim::Utils::Log->addLogCategory({
That's the logging which can be controlled from
Settings/Advanded/Logging. It's part of LMS' logging and shows up in its
server.log file.
> Does this give the capability of viewing the log from within the
> settings page? and will it handle housekeeping the log size?
Yes.
> 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?
I don't think there's anything helping you with this. You could try to
open a socket on each potential port to check for its availability.
Tags: None
Leave a comment: