Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Conversation

@kenany
Copy link
Contributor

@kenany kenany commented Feb 5, 2016

This is, like, the fourth PR to implement this.

I see more and more users now attaching their npm-debug.logs to issues as .docx, .pdf, and .zip. Frankly I don't want to have to download any of these just to see someone's error log. I would like to see more users upload their logs to gist.github.com instead. npm report will help a lot with this, so I would like to get this prerequisite landed.

@iarna
Copy link
Contributor

iarna commented Jun 15, 2016

@kenany My main concern here is that it not fill up user's hard disks. This is particularly a concern for CI environments that could have hundreds of failing runs a day.

To land this, I'd like to see some mechanism that limits the number of logs kept in that directory to something reasonable (say, 10). This could be achieved by, if 10 or more logs exist at startup, removing the oldest until only 9 remain. Doing this at startup means that we don't have to worry about trying to do a bunch of things in the midst of an exit handler.

@kenany
Copy link
Contributor Author

kenany commented Sep 14, 2016

@iarna Can't believe I somehow missed your comment after all this time :(

I'll look into implementing #7614 within this PR as well then.

@legodude17
Copy link
Contributor

Something kidof related that would also help a npm report is to write to a npm-debug.json that includes parsable output so npm report already knows the error.

@kenany kenany force-pushed the debug-log-in-cache branch from 68c5992 to f02c986 Compare October 19, 2016 18:55
isaacs and others added 4 commits October 19, 2016 14:56
@kenany
Copy link
Contributor Author

kenany commented Oct 20, 2016

Added logs-max config (name is akin to cache-max). Log deletion needs to happen after config is loaded so I simply implemented that within npm.load() itself. Might be a better place for it elsewhere; open to suggestions.

Just needs a test now.

@iarna
Copy link
Contributor

iarna commented Jan 24, 2017

Yeah, this seems otherwise ready. I'm going to see if I can't get tests written for it.

(Note from work in progress: I did end up tweaking the filename to be a bit more human readable.)

@iarna
Copy link
Contributor

iarna commented Jan 24, 2017

I fixed a bug (the reported log file name was incorrect) and added a test, so this'll land this week!

iarna pushed a commit that referenced this pull request Jan 24, 2017
We also are storing a configurable number of previous log files.

PR-URL: #11439
Fixes: #5252
Fixes: #6350
Fixes: #1548
Fixes: #7614

Credit: @kenany
Credit: @othiym23
Credit: @isaacs
Credit: @iarna
@iarna
Copy link
Contributor

iarna commented Jan 24, 2017

And it's merged into release-next as 04fca22

@iarna iarna closed this Jan 24, 2017
@zkat zkat mentioned this pull request Feb 14, 2017
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants