Giter Site home page Giter Site logo

log-entry's People

Contributors

gmouron avatar iron7 avatar the-black-wolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

log-entry's Issues

Error at $my.Note trim?

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"

Please License This Framework

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!

Bad link

Link to the Log-Entry.ps1 framwork in the Usage section points to Page not found.

Add switch and toggle to log code line number

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.

Setting -Preserve 0 turns off Divider

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$Dividerrn", $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}

Support Windows Eventlog

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.

How to use the Debug flag?

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.