Opened 11 years ago

Closed 11 years ago

#3511 closed Bug (fixed)

Setting TR_DEBUG environment variable has no effect

Reported by: er13 Owned by: charles
Priority: Normal Milestone: 2.10
Component: Daemon Version: 2.01
Severity: Normal Keywords:
Cc:

Description

Setting TR_DEBUG environment variable has no effect as tr_msgInit (s. tr_sessionInit) is called before the following code fragment:

if( tr_bencDictFindInt( clientSettings, TR_PREFS_KEY_MSGLEVEL, &i ) )
  tr_setMessageLevel( i );

The if-condition always evaluates to true as each session always contains a value for TR_PREFS_KEY_MSGLEVEL (it either comes from settings.json or from populating the session with default values in tr_sessionGetDefaultSettings).

Not sure, whether TR_DEBUG-solution is a good one, I would personally prefer a command-line option instead (see attached patch).

Attachments (1)

daemon_set_loglevel_on_cmdline.patch (1.8 KB) - added by er13 11 years ago.

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by er13

comment:1 Changed 11 years ago by charles

  • Milestone changed from None Set to Sometime
  • Owner set to charles
  • Status changed from new to assigned
  • Version changed from 2.00+ to 2.01

comment:2 Changed 11 years ago by charles

The logging code is one of my least favorite, cruftiest pieces of libtransmission.

Looking over it with this ticket in mind, I can't see any reason to keep TR_DEBUG alive at all.

If we add a verbosity command-line-argument to the daemon, what it ought to do is poke the value of TR_PREFS_KEY_MSGLEVEL before its call to tr_sessionInit(). Poking the session settings benc dict is how most of the daemon's other arguments are processed already.

comment:3 Changed 11 years ago by charles

  • Milestone changed from Sometime to 2.10

comment:4 Changed 11 years ago by charles

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in trunk by r11249, r11250

comment:5 Changed 11 years ago by charles

and r11251 for good measure, too

comment:6 Changed 11 years ago by er13

  • Resolution fixed deleted
  • Status changed from closed to reopened

@charles: may I ask you a question, why did you call the option log-err and not log-error? Could you please rename it to log-error just for the sake of consistency with two other logging options - log-debug(not dbg) & log-info(not inf)? Thanx ;-)

comment:7 Changed 11 years ago by charles

  • Resolution set to fixed
  • Status changed from reopened to closed

I think we're wandering close to bikeshed territory here, but... okay. r11254

Note: See TracTickets for help on using tickets.