Jump to content

Can't get logging to work


BillOatman

Recommended Posts

BillOatman

Hi.  Out of curiosity I am taking a look at the HUE plugin source.  I  updated it to the latest version of the server core, added some info logging and put the dll in the plugins folder and restarted the server.

The Emby server log shows that the plugin was loaded.  But none of my info messages are showing up.

 

The initialization code of the plugin has:

_logger = logManager.GetLogger(Plugin.Instance.Name);

And at the start of the Run method I put:

 _logger.Info("Run event");

However that message does not appear in the log.,  Is there some magic I am omitting?

Or is there plugins 101 info somewhere?  Looked in the developer wiki but didn't see anything.

 

Thanks.

Edited by BillOatman
Link to comment
Share on other sites

BillOatman

I left it where it was already in the source. Just a public method in this class: I merely added the _logger.Info call.

It acts like it isn't even getting to this code.  Is there something else the HueControl method needs to do?

I have attached the server log.  The plugin is HueControl.

public class HueControl : IServerEntryPoint

   
     public HueControl(ISessionManager sessionManager, IJsonSerializer jsonSerializer, IHttpClient httpClient, ILogManager logManager, IUserDataManager userDataManager, ILibraryManager libraryManager)
        {
            _logger = logManager.GetLogger(Plugin.Instance.Name);
            _libraryManager = libraryManager;
            _sessionManager = sessionManager;
            _userDataManager = userDataManager;
            _httpClient = httpClient;
            _jsonSerializer = jsonSerializer;


            Instance = this;
        }
        public void Run()
        {
            _logger.Info("Run event");
            _sessionManager.PlaybackStart += PlaybackStart;
            _sessionManager.PlaybackStopped += PlaybackStopped;
            _sessionManager.PlaybackProgress += PlaybackProgress;


            //_libraryManager.ItemAdded += ItemAdded;
        }

 

HueControl Log.txt

Edited by BillOatman
Link to comment
Share on other sites

BillOatman

The only V4 one that's available, yes.  I did notice though that this project references (via nuget) system.memory.  And the one available via nuget looks like a lower version than the one that is installed with Emby.  I tried building with the Emby one but it would not.  But if dll hell was the problem, wouldn't I see that in the log when Emby tried to load this dll?

 

I attached the solution in case that is quicker and easier than playing 20 questions :)

emby.plugin.HueControl-1.1.0.zip

Edited by BillOatman
Link to comment
Share on other sites

BillOatman

For some reason I cannot delete this post.

post-370467-0-53151500-1556543600_thumb.jpg

Edited by BillOatman
Link to comment
Share on other sites

BillOatman

Hey @@Luke, hold off on looking into this.  The original author plans on getting another code release this week so I can just see what he did to get it to work.

Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...