Skip to Content.
Sympa Menu

freetds - Re: [freetds] Log, patch and format

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Log, patch and format
  • Date: Thu, 9 Dec 2004 08:28:51 -0500

"ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com> wrote:
> I'm trying to change log format to include source line informations (as
> suggested)

[cool patch snipped]

> It's working fine but log format it's not so fine. Just an extract (just
> 3 lines):
>
> 11:20:41.230206 31045 (token.c:320):looking for login token, got
> e3(ENVCHANGE)
> 11:20:41.230238 31045 (token.c:105):tds_process_default_tokens() marker
> is e3(ENVCHANGE)
> 11:20:41.230259 31045 (read.c:178):tds_get_string: reading 8 from wire
> to give 4 to client.
>
> As anyone can see line it's quite long. The reason it's that it contains
> all possible informations:
> - time
> - pid
> - source file and line
> - message
> I know that James don't like that much time at every line but it's very
> useful to discover problems related to speed.
> Perhaps it would be better to define some flags to enable/disable every
> component (time, pid, source and perhaps thread id where pid1 == pid2 do
> not means thread1 == thread2)

I can see the occasional value in including time, and I know even isn't
useful in most situations.

We have a place for a flag to include/exclude columns: the TDS_DBG_*
bitmask.

#define TDS_DBG_TIME __FILE__, ((__LINE__ << 4) | 8)
#define TDS_DBG_PID __FILE__, ((__LINE__ << 4) | 9)

Then reformat accordingly, in tds_dump().

I think time and pid should be disabled in the default mask (currently
'99'), because problems posted to the list normally don't need them. If
someone needs it, we can say "set your log mask to 0xf8" or whatever.

Nice work, Freddy. Thanks for tackling it.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page