Page MenuHomePhabricator

[direnv] Redirect `use flake` to `/dev/null` if `COMM_NIX_LOGGING_LEVEL` is "none"
ClosedPublic

Authored by atul on Mar 12 2023, 7:05 PM.
Tags
None
Referenced Files
F3395187: D7052.id23734.diff
Sun, Dec 1, 2:33 AM
F3395184: D7052.id23657.diff
Sun, Dec 1, 2:31 AM
F3394841: D7052.diff
Sat, Nov 30, 10:42 PM
Unknown Object (File)
Tue, Nov 5, 10:13 PM
Unknown Object (File)
Tue, Nov 5, 10:13 PM
Unknown Object (File)
Mon, Nov 4, 11:29 PM
Unknown Object (File)
Mon, Nov 4, 11:29 PM
Unknown Object (File)
Mon, Nov 4, 11:29 PM
Subscribers

Details

Summary

Found the logging to be kind of annoying. Would prefer if Nix/Direnv worked completely in the background. Realize this is a personal preference so this change won't affect anyone unless they explicitly set COMM_NIX_LOGGING_LEVEL="none".

Test Plan

Before setting COMM_NIX_LOGGING_LEVEL:

1e2bae.png (468×1 px, 342 KB)

After setting COMM_NIX_LOGGING_LEVEL="none":

c0c660.png (110×866 px, 58 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Mar 12 2023, 7:07 PM
atul edited the test plan for this revision. (Show Details)
atul added inline comments.
.envrc
11–15 ↗(On Diff #23657)

I don't know bash so let me definitely know if there's something I'm missing or there's an obviously better way to do this

.envrc
11–16 ↗(On Diff #23657)

bash doesn't have a set "boolean" value pair. Generally you see people setting a variable to nothing VAR= or unset VAR for false values; and setting it to anything else to be true VAR=1

ashoat removed a reviewer: ashoat. ashoat added 1 blocking reviewer(s): jon.
.envrc
11–16 ↗(On Diff #23657)

Ah was hoping for this to be more of an "enum" than a "boolean." As in we might have "none", "error", "verbose", etc. in the future?

I wanted wanted to maintain the default behavior so I didn't want COMM_NIX_LOGGING_LEVEL being unset to disable logs. I wanted disabled logs to be opt-in, so I set COMM_NIX_LOGGING_LEVEL to "something" (in this case "none") in order to toggle that.

atul added a reviewer: varun. atul removed 1 blocking reviewer(s): jon.Mar 14 2023, 9:15 AM
.envrc
11–16 ↗(On Diff #23657)

Then I would invert the intention:

COMM_NIX_QUIET=1

jon’s suggestion makes sense to me

This revision is now accepted and ready to land.Mar 14 2023, 10:07 AM
.envrc
11–16 ↗(On Diff #23657)

gotcha, will update this diff and use SUPPRESS_COMM_NIX_LOGGING as the environment variable instead

atul edited the test plan for this revision. (Show Details)

address feedback

This revision was landed with ongoing or failed builds.Mar 14 2023, 1:08 PM
This revision was automatically updated to reflect the committed changes.