Complete.Org: Mailing Lists: Archives: freeciv-ai: August 2004:
[freeciv-ai] Re: (PR#9659) RfP: Even better AI logging
Home

[freeciv-ai] Re: (PR#9659) RfP: Even better AI logging

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [freeciv-ai] Re: (PR#9659) RfP: Even better AI logging
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxxx>
Date: Tue, 10 Aug 2004 06:42:08 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9659 >

On Tue, 10 Aug 2004, Per I. Mathisen wrote:

> No doubt the immediate problem is caused by settlers patch. We can cull
> this as a short term solution.

Not really, since I was looking at CITY_LOGs, not UNIT_LOGs.
Some code in military unit want prints a lot of crap.

> > BTW, the first argument to *_LOG calls, the loglevel, is almost useless
> > because all calls are debug ones so it is always LOG_DEBUG.
>
> Mostly, yes. However, it is sometimes useful to change one line of code to
> make only one log call emit information.

This is why I propose a couple of "special" groups which emulate this
behaviour.

> > Here are two (mutually exclusive) proposals:
> >
> > 1. Introduce the "priority level", as in
> > CITY_LOG(priority, pcity, message....)
>
> I dislike priority. This was tried with LOG_* and has mostly been a
> failure, IMHO. Nobody uses it. Ditto for gamelog priority.

Ok.

> > 2. Introduce "log group", as in
> > CITY_LOG(group, pcity, message....)
> >
> > The "debug" command becomes
> > debug 2,5,6 city 13 32
> > which switches log messages of groups 2, 5 and 6 for city at (13,32).
> >
> > Groups 0 and 99 are reserved and play the role of PL_FORCE and
> > PL_SPECIAL correspondingly.
> >
> > In the code, the symbolic names of the groups should contain their
> > number as well, so you don't have to look up their value; for example
> > #define LG_MIL_BUILD3 3
>
> This is a much better idea. It should be "debug <group> city <x> <y>",
> where <group> is a string and listed in "help debug", though. A little bit
> more work to implement, but so much more easy to use.

What do you mean by <group> is a string and listed in "help debug"?

> Each group should a bit in bitvector pcity->debug, I guess.

Yes.

Will you make a patch or will we put it as a Help Wanted item, wait for
1/2 year and then you make a patch? ;)

G.




[Prev in Thread] Current Thread [Next in Thread]