Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEBUG_HIDE_DATE environment variable has no effect #765

Closed
cleverlight opened this issue Jun 22, 2020 · 1 comment
Closed

DEBUG_HIDE_DATE environment variable has no effect #765

cleverlight opened this issue Jun 22, 2020 · 1 comment
Labels
question This issue asks a question or requests usage support

Comments

@cleverlight
Copy link

cleverlight commented Jun 22, 2020

Hi folks, I think DEBUG_HIDE_DATE isn't working. The README.md says:

you can set a few environment variables that will change the behavior of the debug logging

but it does not articulate what you can set them to. After reading the code:

if (/^(yes|on|true|enabled)$/i.test(val)) {
		val = true;
	} else if (/^(no|off|false|disabled)$/i.test(val)) {
		val = false;

I'm guessing they can be set to yes, on, true or enabled (positive) or no, off, false or disabled (negative).

I verified this assertion with DEBUG_COLORS:

set DEBUG=present:*,rcf:* && set DEBUG_COLORS=no && nodemon ./bin/www

which yields colourless output correctly.

I then tested DEBUG_HIDE_DATE using the same mechanism:

set DEBUG=present:*,rcf:* && set DEBUG_COLORS=no && set DEBUG_HIDE_DATE=yes && nodemon ./bin/www

which still showed the date, albeit in monochrome. I then tried other variants like disabled ,enabled and off, but the output was the same (with date).

Mon, 22 Jun 2020 12:01:12 GMT present:app microservice initialised

I did wonder if it was limited to my environment (Windows\Cygwin) so I rolled a .Dockerfile to push up a container with the following ENV vars:

ENV DEBUG="*"
ENV DEBUG_COLORS=false
ENV DEBUG_HIDE_DATE=true

I ran the container in a pod on my linux-based K8S cluster and the output was the same (with date). I also tried the enabled and disabled variants just in case I'd misinterpretted grammar. Any kind of clarification appreciated, or if it's deprecated perhaps it could be removed from the docs?

@Qix- Qix- added the question This issue asks a question or requests usage support label Jun 22, 2020
@Qix-
Copy link
Member

Qix- commented Jun 22, 2020

Hide date from debug output (non-TTY).

As specified, it only works if you're piping output to something else (non-TTY mode).

I realize this is bizarre behavior; the next version is slated to fix this (whenever it happens). See #556 and #656.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue asks a question or requests usage support
Development

No branches or pull requests

2 participants