WIP 847, solve 1008, solve 1010#1009
Conversation
|
Trying to figure out what happened with the CI build. Works On My Machine™ |
|
That turned out to be rather subtle. The tests were all passing in VS with whatever test runner I tried, but were failing on the command line. I then switched VS to release config and it also failed. I tracked it down to this https://github.com/adamralph/scriptcs/blob/871c88bee11ec0130e9383eee52f26a2a4552960/src/ScriptCs.Contracts/Logging/LogProviderExtensions.cs#L14 The JIT was inlining the method in the release build which fatally altered the stack, causing this particular piece of magic to fail. It's the same method as used in LibLog so it's proven to work (https://github.com/damianh/LibLog/blob/69873d63d382073ac16266a071654fb01fdd4b46/src/LibLog/LibLog.cs#L438-L439) but over there it's not an extension method so it doesn't get inlined. I tried splitting it into two lines to match the LibLog impl. exactly but it made no difference. I guess LibLog may also be liable to this problem, but it's been getting lucky so far just because of the way that the JIT heuristics work out. I'll probably raise an issue over there for consideration. |
|
You could try adding a |
|
Uh. Looks like that's already done. Damn mobile views... |
|
As far as I can see, this PR now completes all the logging changes envisioned so far. It is using the latest version of LibLog (4.1.1) which contains a new feature which I contributed (damianh-archive/LibLog#56) allowing LibLog to function purely as a provider of out of the box support for common logging frameworks and sitting, internally, underneath the public logging API of the consuming library. To summarise:
To clarify, these changes are independent of the decision we take regarding breaking changes for 0.15 (see #996 (comment)). If we do decide to reinstate the Common.Logging overloads for a transition period then this can be done later, independently of these changes. |
|
rebased |
|
Added one more commit: LibLog 4.2 no longer logs to the console by default which removes the need to publicly expose |
|
Rebased and upgraded to LibLog 4.2.2 |
|
rebased |

Re #847 - move the logging interfaces from Core to Contracts, so that anyone referencing Contracts can continue to get one injected, as the WebApi2 script pack does
fixes #1008 by switching from passing around
ILogto passing around anILogProvider. This also allows anyone who gets an logging interface injected to create a logger specific to them. E.g. the WebApi2 script pack can create a "WebApiPack" logger or even one for each type. If we exposeILogProviderto scripts, they can create a logger with the script name, etc.This is the console output at debug level after this change:
fixes #1010