Opened 13 months ago

Closed 8 months ago

#26888 closed enhancement (implemented)

torsocks: --quiet option

Reported by: ilf Owned by: dgoulet
Priority: Medium Milestone:
Component: Core Tor/Torsocks Version:
Severity: Normal Keywords: torsocks, quiet, option
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

IMHO, torsocks could use a --quiet option.

Interactively, torsocks errors and warnings regularly interfere with ncurses rendering, which create annoying display issues in applications like Mutt.

In scripts, torsocks errors and warnings make STDERR more verbose. Filtering Torsocks STDERR also takes away the STDERR of the actual applications I torify. I might be interested in applications STDERR but not torsocks STDERR. There's probably a way to achieve that, but torsocks --quiet would be really simple.

Since torsocks fails closed, I would feel comfortable to use torsocks in a --quiet mode in these cases.

Child Tickets

Change History (2)

comment:1 in reply to:  description Changed 8 months ago by onirony

Status: newneeds_information

What version of Torsocks are you using? The current source code at https://gitweb.torproject.org/torsocks.git/tree/ supports the -q/--quiet option. The man page that came with torsocks when I install it via brew also says the following:

       -q, --quiet
              Suppress every log messages [sic] (even errors).

For some reason, when I just enter the torsocks command on the terminal this option isn't presented with all the others, even though it exists and is documented in the man page (not sure if there's a reason, to me it seems like it should appear with all the rest of the options).

Anyway, using -q sets a variable within torsocks called TORSOCKS_LOG_LEVEL to 1. Torsocks checks this variable before outputting errors. The lower the level, the more conservative Torsocks is about logging. 1 (quiet mode) is the lowest level. The highest level is 5, which is set via the -d/--debug option.

What system are you on and how did you install torsocks? If you installed it using a package manager it's possible they provide a version that predates the -q option. If that's the case, torsocks is pretty easy to build yourself by cloning the git repo (https://gitweb.torproject.org/torsocks.git/tree/) and following the instructions here:
https://gitweb.torproject.org/torsocks.git/tree/README.md

If it is the case that your package manager gave you a torsocks that lacks -q I'll bug the repository maintainers to use a newer version so that others don't have to go through this.

comment:2 Changed 8 months ago by ilf

Resolution: implemented
Status: needs_informationclosed

Oh, you're right. I use 2.3.0 and --quiet is there and works as expected. Sorry for the noise, and thanks for the work!

Note: See TracTickets for help on using tickets.