Ticket #48005

How to activate UNIT_LOG, or CITY_LOG ?

Date d'ouverture: 2023-05-10 01:22 Dernière mise à jour: 2023-05-11 21:21

Rapporteur:
Propriétaire:
(Aucun)
Type:
État:
Ouvert
Composant:
Jalon:
(Aucun)
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Aucun
Fichier:
Aucun

Détails

I did configure with -enable-debug options, but this is not enough for all specific logs. What must i do to have this ?

      UNIT_LOG(LOG_DEBUG, punit,
                 "%d itself acted due to displacement recursion. "
                 "Was going from (%d, %d) to (%d, %d). "
                 "Now heading from (%d, %d) to (%d, %d).",
                 punit->id,

Ticket History (3/4 Histories)

2023-05-10 01:22 Updated by: alain_bkr
  • New Ticket "How to activate UNIT_LOG, or CITY_LOG ?" created
2023-05-11 19:58 Updated by: alain_bkr
Commentaire

I checked the doc, and found nothing.

$ fgrep -i debug doc/* 2>/dev/null
doc/BUGS:   - If Freeciv "dumps core", then we may ask you to use a debugger to
doc/CodingStyle:- Always check compilation with the configure option --enable-debug set.
doc/FAQ:   This will help you get some debug information, which might give a clue
doc/HACKING:The autogame mode with timeout -1 is only available in DEBUG versions
doc/HACKING:log levels (log_fatal(), log_error(), log_verbose(), log_debug()) should
doc/HACKING:Debugging and Profiling
doc/HACKING:Debugging has to be activated on compile time. For autotools based builds
doc/HACKING:that's done by adding the option '--enable-debug=no/some/yes/checks'
doc/HACKING:to the configure script. See m4/debug.m4 for exact compiler flags each
doc/HACKING:  no:     no debugging enabled(FREECIV_NDEBUG and NDEBUG are defined)
doc/HACKING:  some:   default build (neither FREECIV_NDEBUG nor FREECIV_DEBUG is defined)
doc/HACKING:  yes:    debugging enable (FREECIV_DEBUG is defined)
doc/HACKING:          debugging log level available (4, log_debug())
doc/HACKING:          more compiler warning flags than with lower debug levels
doc/INSTALL.meson:debug (boolean):
doc/INSTALL.meson:  Whether debug version of Freeciv should be built. While this is generic
doc/Makefile.in:	$(top_srcdir)/m4/debug.m4 $(top_srcdir)/m4/emscripten.m4 \
doc/README:"warning", "normal", "verbose", and in debug builds "debug".
doc/README:You can change the level of log messages displayed with "--debug
doc/README:If you compiled with FREECIV_DEBUG defined (an easy way to do this is to
doc/README:configure with --enable-debug), then you can get debug level messages
doc/README:by setting the level to "debug" (or 5). Also, it is possible to
doc/README:control debug level messages (but not other messages) on a per-file
doc/README:and per-line basis. To do this use "--debug debug:str1:str2" (as many
doc/README:match those strings as a substring will have debug log messages
doc/README:turned on, and all other debug messages will be suppressed.
doc/README:To control lines, use: "--debug debug:str1,min,max" and for files which
doc/README:match str1 only debug messages within the specified minimum and maximum
doc/README:  |  % freeciv-gtk3.22 --debug fatal
doc/README:  |  % freeciv-server -d debug:log:civserver,120,500:autoattack
doc/README:server, and debug level messages for some specified modules. Note
doc/README:"civserver.c", debug messages between lines 120 and 500 will be
doc/README:FREECIV_DEBUG.
doc/README.AI:hell to debug but means that small bugs don't affect overall picture
doc/README.AI_modules:unless one has configured with --enable-debug which allows freeciv

I'll write some documentation if needed, or add a link to relevant place, but i need a clue to start.

2023-05-11 19:59 Updated by: alain_bkr
  • Composant Update from (Aucun) to Documentation
  • Type Update from Demande de soutien to Bogues
2023-05-11 21:21 Updated by: cazfi
Commentaire

It's a macro defined in server/srv_log.h . There's bunch of macros defining the log levels it produces near the top of the file.

Attachment File List

No attachments

Modifier

Please login to add comment to this ticket » Connexion