iron7 / log-entry Goto Github PK
View Code? Open in Web Editor NEWDisplays and records cmdlet processing details in a file
License: GNU General Public License v3.0
Displays and records cmdlet processing details in a file
License: GNU General Public License v3.0
I'm getting an error on this line:
$My.Notes -Split("\r\n") | ForEach {$Note = $_ -Split(":", 2); If ($Note[0].Trim()) {$My[$Note[0].Trim()] = $Note[1].Trim()}}
Whenever I try to run, it runs ok, but there's an error message:
"Error at 259,86: Não é possível chamar um método em uma expressão de valor nulo."
translates to "not possible to call method in expression of null value"
This project looks awesome and I'd love to use it, but I have one (hopefully simple) question. Can you provide a license for this project? Right now, I don't see a license mentioned anywhere in the source.
Obviously the choice of providing a license (or not) is solely yours, but some companies (mine included) will be unable to use this code without one. If that's your intention, fair enough. I just thought I'd point it out.
Cheers!
Link to the Log-Entry.ps1 framwork
in the Usage section points to Page not found
.
Hi. This is not an issue but a feature request. Hoping to get a switch -linenumber [alias -line] to optionally add the line number to the log. Also, a global toggle to turn logging of line numbers on by default.
Thanks so much for making the effort to write and also publish this amazing tool.
I'll try to add this feature myself when I have some time.
I can tell you must have put so much time into it, ironing out all the bugs and weird edge cases. I did the same myself with Batch logging back in the day and never had the heart to convert it to powershell so yours is perfect.
It looks like the line of code in the function Set-LogFile to print the divider is one block too high. If placed one block lower, then the divider will print in cases where Preserve is set to 0.
If ((Test-Path($Location)) -And $Preserve) { $My.Log.Length = (Get-Item($Location)).Length If ($My.Log.Length -gt $Preserve) { # Prevent the log file to grow indefinitely $Content = [String]::Join("
rn", (Get-Content $Location)) $Start = $Content.LastIndexOf("
rn$Divider
rn", $My.Log.Length - $Preserve) If ($Start -gt 0) {Set-Content $Location $Content.SubString($Start + $Divider.Length + 4)} } } If ($My.Log.Length -gt 0) {Add-content $Location $Divider}
Hi @iRon7
Very well designed library. I somehow missed it in my initial search for a well done logging solution so I designed my own. I have a GNU/Linux and Python background and am involved with central logging using Elasticsearch, so my focus was not so much on writing a log file but instead writing to the Windows Eventlog with the reason being to collect the Eventlog and store/index it centrally.
Adding support for the Eventlog might also be interesting for you. In #5 you wrote that you are already working on a redesign.
Also, I share your opinion that MS Shell/M$Shell is lacking a proper logging framework.
My solution: https://github.com/geberit/elastic-helpers/blob/master/logging_examples/logging.ps1
Our view on logging: https://github.com/geberit/elastic-helpers/blob/master/Logging%20best%20practices.md
Maybe we can combine forces somehow. Let me know what you think.
I've tried running .\myscript.ps1 -debug but it doesn't seem to show debug lines in the logfile.
Can't see any examples in the readme. Not sure what I'm doing wrong.
Thanks for your help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.