Giter Site home page Giter Site logo

chocologparse's Introduction

ChocoLogParse

Parses Chocolatey logs into easy to use objects.

PowerShell Gallery PowerShell Gallery Version GitHub Workflow Status PowerShell Gallery

Docs automatically updated at heyitsgilbert.github.io/ChocoLogParse

Available via the PowerShell Gallery

Overview

Parsing the Chocolatey logs can be daunting because at first glance it's difficult to see when things change from one thread to the next. Other tools like cmtrace don't support the Log4Net format. This module gives you a simple way of converting the logs into a simple to parse/filter objects.

To also help improve discoverability we included an object formatter so that you can quickly see error log entries, etc.

Installation

Install-Module ChocoLogParse

Examples

To parse the latest Chocolatey log file run the following.

Import-Module ChocoLogParse
$logs = Read-ChocoLog

Find install attempts of specific app (zoom in this example)

Read-ChocoLog | ?{ $_.cli -like "*zoom*"}

Once you found your thread you might want to filter in/out debug.

$logs[0].logs | ?{ $_.level -ne 'DEBUG' }

To grab the latest log you can use Get-ChocoLogEntry. Which is also includes a -Report flag to print an easier to read set of logs and highlight some key information at the top.

Get-ChocoLogEntry

Get more details at heyitsgilbert.github.io/ChocoLogParse

Building and Testing

If you want to contribute or would like to make a local build you just need to run the build.ps1 script with the relevant task.

For your first run you'll want to run the Bootstrap which will fetch all the appropriate modules and tools (as seen in the requirements.ps1).

.\build.ps1 -Bootstrap -Task Test

Building and testing works on Windows PowerShell and PowerShell Core.

chocologparse's People

Contributors

heyitsgilbert avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

chocologparse's Issues

Update to Env Var

Currently this is looking for a specific folder (C:\programdata\chocolatey) and we should be looking for $env:ChocolateyInstall

Handle Mixed Threads during Parse

It's possible that two instances of Chocolatey could be running. This could
result in logs between both sessions being intermixed. The code should be
updated to check for and handle that.

Change From ArrayList to Generic.List

Tester ran into odd edge case where ArrayList was marked as fix size. It was suggested to switch type for perf.

Should probably swap to system.collections.generic.list for the next version as its supported, more performant (not likely needed) etc

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.