Comments (3)
Hi @kungfu71186 - I know what you mean. There are a lot of common messages that it would be good to have use across resources. However, there are a lot of resources where these wouldn't be able to be applied - e.g. resources where properties aren't retrieved individually. I guess the challenge is determining what are the common messages that all resources should log? This might be quite difficult.
Perhaps it would be good to start with a higher level verbose logging strategy that defines what should be logged and when? I often see:
- logs for the sake of logs (I'm guilty of this and trying to do better).
- logs that double as code comments. E.g. adds no diagnostic detail, just a description of the code that was run.
- lack of key information in logs. E.g. Missing a critical piece of diagnostic data from the message (see "Setting the IP address on the adapter".... setting it to what? On what adapter? What Address Family?)
From my experience it might be good to focus on giving guidance around what is useful in logs would be helpful.
Not saying common messages aren't a good idea, just saying that the common messages might only be common across a smaller subset of resources than expected. E.g. the two listed above I only use in about 5% of the resources I maintain (it's not a pattern I've needed much).
from dscresource.template.
@PlagueHO That's why I saying that this really isn't about the messages per say, just the ability to have it there.
We used something similar for localized data in another project where it would automatically take the localized data, but you could override or add your own if you wanted to.
So something similar where if I load the localized helper module, it will take what's in that resource and take the common ones and combine them. No extra work on anyone's part, but now you can use common messages if you wanted to.
from dscresource.template.
You mean that Get-LocalizedData
should load a common string library (en-US if the specific localized language is not available), and then load the resource specific strings that will override any duplicate in the common string library? The total is returned by Get-LocalizedData
. That could work, I like that idea.
@PlagueHO I was thinking the exact thing yesterday when I adding localization to resources in SqlServerDsc. Depending on the day I add verbose strings differently 😞 Though, I try to minimize the change in the resources, so don't want to add verbose string, where no aren't already, but I see the resources are very differently in what is outpute, just as you menationed. Some don't output anything really. And some is "diagnostics". I kind of like "diagnostics", it's easier to debug the code when a user can give the verbose log, and you can follow what happens. But then it need to show the actual values.
I agree we need guidance what to log, where and when. 😄
from dscresource.template.
Related Issues (20)
- Create dev branch and make it the default branch for PRs
- Discussion: Add Optional files for Autodocumentation Wiki Repos HOT 1
- Should we add Class resource examples to template HOT 5
- Add *.exe as binary to .gitattributes in Template
- Integration test 'Should return $true when Test-DscConfiguration is run' does not fail HOT 1
- Mandatory Parameters for get-targetresource HOT 3
- How TargetResource functions should be used discussion HOT 3
- DscResource.LocalizationHelper Module is misnamed HOT 7
- Suggest moving TEMPLATE_README.md to the Wiki HOT 1
- Add Opt-in to Common Tests - Validate Localization
- Common Verbose logging and standards HOT 2
- Update indentation style in settings.json (VS Code formatting) HOT 6
- Using .json with Integration tests does not work
- Unit Test Template: Remove unnecessary comment
- Connect Codecov to DscResource.Template
- Connect AppVeyor to this repo
- Minor typos in unit test template HOT 1
- Keep the old change log history HOT 1
- Update GitHub PR template
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dscresource.template.