choco icon indicating copy to clipboard operation
choco copied to clipboard

Add log/gist-log commands

Open yurikoles opened this issue 10 years ago • 2 comments

It will be very useful to have command that just opens chocolatey.log It may be very boring to rerun installer with -v/-vd or to copy-past log file location from shell window, as it is very hard to not select surrounding brackets.

Another useful command may be gist-log inspired by brew gist-logs "formula name", e.g. upload log of package install to gist.

yurikoles avatar Nov 20 '15 09:11 yurikoles

Hi, The task has a low priority and has been waiting for 6 years - I'm newbie so it is not critical and I can try my hand at it. I have two commands in my head:

choco log - which will open chocolatey.log file choco log -o / choco log --output - which will display chocolatey.log content in console.

What do you think?

BElluu avatar Dec 23 '21 11:12 BElluu

Those sound reasonable to me.

A few things to think about:

  • Are we attempting to directly launch chocolatey.log (akin to Invoke-Item chocolatey.log in PowerShell)? If we're doing that, what happens if they don't have a handler for .log files? Will it fail? If it fails do we fallback on launching notepad.exe chocolatey.log?
  • For --output do we default to outputting the entire (up to 10MB) file? Or do we limit it to X lines? If we limit it to X lines, that should be both a configuration option and a parameter that you can pass in.
  • In the case where we're outputting to the console, what happens with the logging for the current run of Chocolatey? It would seem best to not output that stuff, but I'm not sure right now how we'd prevent that, and perhaps we just need to ensure it's not logging while it's reading/outputting 🤔

These are just things that come to mind when I look at this issue and think about some of the possible scenarios you might want to consider as you start working on the command.

corbob avatar Dec 23 '21 17:12 corbob