Skip to content

DebugCompilationFlags

Max S edited this page Jun 4, 2018 · 2 revisions

Debug Compilation Flags

This article describes the various debug flags that can be enabled during the compilation to collect additional debugging information during the development. Note that most of them will have at least some performance loss and generate additional logging information so it is not recommended to enable them in production. In case of the test package the module provides external slave server callables that most definitely should not be enabled in production.

To enable any compilation flag you need to add the "-D flag_name" line to the uniserver and/or cache server and game server .hxml files.

Usage example (uniserver.hxml):

-main UniServerTest
-neko uniserver.n
-dce no
-D uniserver
-D no-pattern-matching
-D deprecation-warnings
-D debug_test_package

-cp game/
-cp cache/
-cp ../../
-cp ../../tools/threadname/
-cp ../../external-libs/npostgres/
-cp ../../external-libs/hxnet/

Any enabled flags will be displayed on server start:

Debug compilation flags: -D debug_test_package

The following debug flags are supported:

  • "debug_http_format" - Each client request is treated as HTTP query and each server response is wrapped in HTTP headers (essentially the server becomes a web server).
  • "debug_extendedProfiler" - Profiles every main worker call in the slave server. Also monitors the main worker queue length and writes that info into the real-time stats log. Does not have any effect on cache server.
  • "debug_logTiming" - Logs timings for all important parts of message handling from receiving it to sending response. Will use separate logger thread to save all gathered data into "debugTiming/" directory in CSV format. Has additional information for each part of user login and user registration message handling. Some serializer and sender-specific aggregate timing data will also be logged into the real-time stats log. Also note that not all of the names in this data will be descriptive enough to understand what they stand for without looking into the core code.
  • "debug_monitorSerializerQueue" - When enabled, monitors serializer queue length every second and puts it into real-time stats log.
  • "debug_singleThread" - Disables slave worker and serializer thread pools and runs client request handling and serialization work in the client connection threads.
  • "debug_testMessage" - Disables all client message handling and serialization, answering each request with a static response instead.
  • "debug_testMessage_http_compatible" - Disables all client message handling and serialization, answering each request with a static HTTP response instead. Needs "debug_testMessage" enabled.
  • "debug_test_package" - Will enable test messages package during the compilation. You can read more about it in the Test Messages article.
  • "debug_websocket" - Outputs various websocket debugging data into console.
Clone this wiki locally