-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation #21
Comments
It's a very good idea and DocFX allows to add arbitrary MD documents alongside the generated API doc. Personnaly I'd love to read a real life example about how to use your I'm thinking about a console or WPF application created from scratch that will do some simple work, and more complicated work ... possibly asynchronously ... with aggregated exceptions ... etc. The idea behind this is to demonstrate how to setup the whole thing, how to use it normaly (no fancy tricks), what output you can expect from it, and finally explain the theory behing it. It would be so nice to be able to use this thing without being forced to have @olivier-spinelli in the office 😉 . |
:) You actually need 2 lines of code in your 'main':
This uses the RooLogPath defined in Application.config file if it exists:
... Or a "Logs" sub folder in the executable folder.
And the default GrandOutputConfig.xml file that is automatically monitored (any change to it will reload the new configuration of the GrandOutput):
That's it. |
Thanks ! I now have the a good example of the initial setup. But I still have a lot of questions coming from this 😲 :
Ok, I'll read the code I'm too curious now. But still, I think a quick start with a step by step example that demonstrate the different entities and how you can use it could be a very helpful for an external user or even a new comer at Invenietis. I'll be happy to help if you need. I think I know little enough to review the doc like a total beginner :) Ps: And by the way the default configuration of the "GrandOutput" currently uses a binary file |
I've set up a DocFX output over at http://bcrosnier.github.io/ck-core/ using my forked repo (DocFX source). Not much for now, but it's a start. If this looks all right, I can make a PR and reel it in here. I agree with basically all of @ablanchet's questions, with a bonus "Why the hell would I want to use that over common-logging or NLog or whatever".
The text file has been set as default starting with version 5.0.0-epsilon, which is in prerelease right now (latest stable is still 4.2). Admittedly,
Good question. Wonder if it could be renamed to some kind of |
Congratulations, you just gave birth to the OAK (Once Asked Questions 😃)! What's an ActivityMonitor?It is a rather small object you use to send logs into. It is not thread-safe and not thread-affine: it is tied to an "activity', i.e. a logical sequence of operations (whatever the actual thread is actually doing the job). A single instance is then perfectly adapted to aysnc/await and other continuations patterns. The IActivityMonitor abstraction exposes only 10 members. This lightweight interface makes façade/wrapper/hook very easy to implement if needed. However this is not the way we most often use/extend it... almost every feature are achieved through the Clients. What's a Client ?A IActivityMonitorClient is registered on a monitor and will receive the structured logs and can do what it wants with them. Have a look at the ActivityMonitorConsoleClient that specializes ActivityMonitorTextWriterClient for a simple example. Registering a Client to a monitor is simple:
And removing it is obvious; This leads to an interesting pattern: locally create and register a Client to monitor things...
...or to alter things:
This example leas us to on important point: the filter management that is quite different from other logging framework. What's the MinimalFilter and ActualFilter?The ActivityMonitor acts as a mediator between multiple participants regarding what it SHOULD log. The developer can set the What's the recommended way to obtain an ActivityMonitor?Good question! Very simple answer:
Wow you can bridge through app domains ? CrazyYes it was. But no more. We removed this in the 5.0.0 version to follow the dotnet evolution where AppDomains are dead. Is it possible to add custom serializer in order to lower the allocations while creating binary logs?Yes of course. However the immutable LogEntry object that is received by the sink will still need to be allocated. I think it is possible to limit the allocations by allowing log entries to be reused (pool of entries) but there will always be all the small strings (the message itself) that need to be allocated... Why "GrandOutput" ? Is it some kind of a logging guru ?The intent (see http://www.dictionary.com/browse/grand) is that you never need anything else because it is "impressive", "highly ambitious", "includes everything"... |
Looks good, if it's possible it would be nice to use a It's a good start anyway, the code doc is fairly good and reading it on a browser help a lot to understand the different entities (at least the interfaces etc). I can't wait to have the answer to
I haven't even dared to ask this to my almighty former boss 😝 (wow @olivier-spinelli that's a big comment, better start a FAQ on the CK.Core's DocFx instead of OAK here don't you think ?) |
I added preliminary information about the ActivityMonitor over at http://bcrosnier.github.io/ck-core/articles/using-the-activitymonitor.html . I'm going to submit the PR with the DocFx project. We can continue from there. |
I've added doc for the CK.Core assembly over at http://bcrosnier.github.io/ck-core/articles/ck-core.html . I'll let you guys read before submitting a PR. |
This is to gather ideas for a documentation about the various components of CK-Core.
I intend to make a PR initializing this soon with DocFX.
What we're interested in is not only the raw API documentation, which is basically written in the code, but also more general overviews of the various components, with general use cases.
The
README.md
has the general idea, but needs some buffing up.The text was updated successfully, but these errors were encountered: