diff roundup/cgi/wsgi_handler.py @ 8487:b09ef85f0da6

feat: add nanoid pkg trace_id gen and decorator for setting processName nanoid is a shorter unique id generator and faster than uuid. I truncate nanoid id's to 12 chars to make it more readable. Also added decorator to allow setting the default processName definition in the logging module. admin.py and wsgi_handler now set processName. configuration.py knows how to overide the processName if set to the default MainProcess. Updated install docs to add nanoid as optional, how to switch to different trace_id output. pydoc generated docs include logcontext module and are referenced from admin.py.
author John Rouillard <rouilj@ieee.org>
date Mon, 08 Dec 2025 00:23:14 -0500
parents 617d55f1d518
children f80c566f5726
line wrap: on
line diff
--- a/roundup/cgi/wsgi_handler.py	Sat Nov 15 16:59:24 2025 -0500
+++ b/roundup/cgi/wsgi_handler.py	Mon Dec 08 00:23:14 2025 -0500
@@ -13,7 +13,7 @@
 from roundup.anypy.strings import s2b
 from roundup.cgi import TranslationService
 from roundup.cgi.client import BinaryFieldStorage
-from roundup.logcontext import gen_trace_id, store_trace_reason
+from roundup.logcontext import gen_trace_id, set_processName, store_trace_reason
 
 BaseHTTPRequestHandler = http_.server.BaseHTTPRequestHandler
 DEFAULT_ERROR_MESSAGE = http_.server.DEFAULT_ERROR_MESSAGE
@@ -107,6 +107,7 @@
             "cache_tracker" not in self.feature_flags or
             self.feature_flags["cache_tracker"] is not False)
 
+    @set_processName("wsgi_handler")
     @gen_trace_id()
     @store_trace_reason("wsgi")
     def __call__(self, environ, start_response):

Roundup Issue Tracker: http://roundup-tracker.org/