Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: [RFH] Switching on DEBUG logging.

[Freeciv-Dev] Re: [RFH] Switching on DEBUG logging.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [RFH] Switching on DEBUG logging.
From: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Date: Tue, 19 Mar 2002 06:05:21 -0800 (PST)

--- Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx> wrote:
> Request for help:
> To perform debug logging right now I just change LOG_DEBUG to 
> LOG_NORMAL for the messages that would interest me.  Out of ignorance, of 
> course.
> I am aware that you can switch 4th level messages on (and I even did that 
> once --- and got swamped wih messages).  I later learnt that it is 
> possible to provide commad line args to specify which messages of 
> LOG_DEBUG level you want to be shown.  But I never managed to do it (and 
> never managed to repeat my first "switch them all on" experience either).
> Could you please tell me how to do it, step by step?
Which F**ing manual? This one from README, in the main directory.

Log messages:
Both the client and server print messages known as "log messages".
There are five categories of log messages: "fatal", "error", "normal",
"verbose", and "debug".
By default, fatal, error and normal messages are printed to standard 
output where the client or server was started.  You can direct log 
messages to a file instead of the screen with the "--log filename", 
or "-l filename" command line options.
You can change the level of log messages displayed with "--debug
level" or "-d level" (or instead "-de level" for the Xaw client, since
"-d" is ambiguous between "-debug" and "-display"), where "level" is
0, 1, 2, or 3.  0 means show fatal messages only, 1 means show fatal
and error messages, 2 means fatal, error and normal messages (the
default), and 3 means show all fatal, error, normal, and verbose
If you compiled with DEBUG defined (an easy way to do this is to
configure with --enable-debug), then you can get debug level messages
by setting the level to 4.  Also, it is possible to control debug
level messages (but not other messages) on a per-file and per-line
basis.  To do this use "--debug 4:str1:str2" (as many strings as you
like, separated by colons) and any filenames which match those strings
as a substring will have debug log messages turned on, and all other
debug messages will be suppressed.  To control lines, use:
"--debug 4:str1,min,max" and for files which match str1 only debug
messages within the specified minimum and maximum lines will be
printed.  Only one set of (min,max) can be applied to each file.
|  % civserver -l my.log -d 3
This sends all server log messages to file "my.log", including verbose
level messages.
|  % civclient --debug 0
This suppresses all non-fatal client log messages.
|  % civserver -d 4:log:civserver,120,500:autoattack
This turns on all fatal, error, normal and verbose messages for the
server, and debug level messages for some specified modules.  Note
that "log" will match "gamelog.c" as well as "log.c".  For
"civserver.c", debug messages between lines 120 and 500 will be
printed.  This example only works if the server was compiled with
> Thanks,
> G.
> P.S. Please don't tell me to RTFM.  For I have an argument against it: 

Do You Yahoo!?
Yahoo! Sports - live college hoops coverage

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