dwmkerr / sharpshell

SharpShell makes it easy to create Windows Shell Extensions using the .NET Framework.
MIT License
1.5k stars 261 forks source link

Problems with the debug log #218

Open Countryen opened 5 years ago

Countryen commented 5 years ago

Hey, I can't read the debug logging output. File logging output works well.

As stated here: https://github.com/dwmkerr/sharpshell/blob/master/docs/logging/logging.md

I have a working server with working "Log(...)" calls (see below, File Debug Output). I configured with srm

srm config LoggingMode "Debug, File"
srm config LogFilePath "<PathToMyFile>"

Installation & Registration via Server Manager, everything works fine. Problem: DebugView doesn't display my logs at all, but other log is shown.

Following configuration: image (Note: I do start Dbgview.exe (v4.81) with elevated rights, no VS running)

My File Debug Output:

2018-10-28 23:20:18.943Z - explorer - Prototype12Server: Initializing shell extension...
2018-10-28 23:20:18.949Z - explorer - Prototype12Server: Shell extension initialised.
Parent folder: <none>
Items: 
D:\file1.msg
2018-10-28 23:20:18.955Z - explorer - Prototype12Server: Query Context Menu for items: 
D:\file1.msg
2018-10-28 23:20:18.958Z - explorer - Prototype12Server: System.Diagnostics.StackFrame.CanShowMenu: Start
2018-10-28 23:20:18.960Z - explorer - Prototype12Server: System.Diagnostics.StackFrame.CanShowMenu: End
2018-10-28 23:20:18.963Z - explorer - Prototype12Server: System.Diagnostics.StackFrame.CreateMenu: Start
2018-10-28 23:20:18.965Z - explorer - Prototype12Server: System.Diagnostics.StackFrame.CreateMenu: End
Countryen commented 5 years ago

Also I noticed that the change (of Logging Mode) only takes affect after restarting explorer.exe (for documentation)

dwmkerr commented 5 years ago

Very strange - I've just tried something similar with 2.6, using the srm tool to set the same logging options, and I see the log output:

image

Once you restarted explorer was it all OK? An explorer restart is necessary at the moment because the logging configuration is read only once, at the time of the first log call. After that it won't be reloaded for the process. It might be possible to watch the registry key but I'd rather focus on fixing some property sheet issues and the namespace extensions first!

Do you see any log output from the srm tool itself?

Countryen commented 5 years ago
  1. I don't use the SRM (but the Server Manager), so no I don't see SRM logging
  2. No, I still see no logging output in the DebugView, even after restarting a bunch of times.

I will try it with my slow ass laptop (and srm) and report my result. Maybe some other app catches the log before DebugView can - but I see the same logging for "VSMOUT".

I do see a lot "Lizard Mode" entries... I wonder what that means.

Countryen commented 5 years ago

Okay 2 things I found:

On my laptop it works, but only after I set the registry keys with the srm tool, not by hand (maybe I missed something).

"Lizard Mode" I guess is something from the Steam Controller. I do have one, but currently not connected and offline. I stopped Steam and the "Lizard Mode" messages disappeared. I now see the "Sharp Shell Diagnostics Initialised" and then some error for a faulty Server, but not MY logging in the actual server's action. I have a Log()-Call on click on a ContextMenuItem.

It's not my biggest priority right now but will soon test out some more. Still, file logging works well.