morgan icon indicating copy to clipboard operation
morgan copied to clipboard

Add colored status token

Open st-sloth opened this issue 6 years ago • 8 comments

Coloring status makes sense for whatever format user wants, not just the internal dev one. So using :status-colored gives that ability.

Had to edit tests because, in master, status coloring is being disabled after a space following status specifically in dev format. Now coloring is disabled right after status text.

As for collaterally removed memoization for dev format, well, wouln't it be better to memoize all formats that go through compile, not just the dev one? If that's the case, I'll do that separately.

resolves #171

st-sloth avatar Jul 14 '18 16:07 st-sloth

Hi @st-sloth sorry I never saw your PR. I'm currently going through the repo and cleaning up the issues / PRs which is how I found it. So I think this is a good idea, though it just needs a rebase to fix the conflicts after I merged a couple other PRs.

As for your memoize question, the compile is a public function and since memoization has no expiration and currently users could be generating a new format on every request for who knows what reason, it is unlikely to be safe to suddenly add an unbounded cache to this function.

But maybe I'm completely misunderstanding your question.

dougwilson avatar Nov 05 '18 03:11 dougwilson

@dougwilson, that's alright!

As for your memoize question, the compile is a public function and since memoization has no expiration and currently users could be generating a new format on every request for who knows what reason, it is unlikely to be safe to suddenly add an unbounded cache to this function.

Yes, you are correct. I guess I didn't think about this at time of the opening of the PR.

Anyway, I rebased the branch onto the current master and resolved the conflicts. Now it's ready to be merged, if you're accepting this change.

st-sloth avatar Dec 01 '18 15:12 st-sloth

Will this get merged soon?

tahv0 avatar Feb 27 '19 12:02 tahv0

Any updates? I implemented this manually for my self, but it would be much more elegant if this could be in the original base.

Inkbug avatar Oct 25 '19 12:10 Inkbug

@st-sloth are you still working on this? I picked it up in this PR and am working on updating the tests https://github.com/expressjs/morgan/pull/227

ryhinchey avatar Feb 27 '20 22:02 ryhinchey

@ryhinchey No, I'm done and have been waiting for a reply or merge ever since. Happy to see it picked up, revived and bettered, thank you! Good luck with your PR!

st-sloth avatar Feb 27 '20 23:02 st-sloth

Any updates on this? This would be really helpful.

Vivida1 avatar May 25 '21 13:05 Vivida1

Still not merged..?

adamreisnz avatar Jul 14 '21 07:07 adamreisnz