e7299b17e9
Stack installed: - netfox v1.35.3 (core + extras + noray + internals) - godot-jolt v0.16.0-stable Architecture: - Server: ENet transport (works headless, no netfox deps) - Client/Editor: netfox rollback (RollbackSynchronizer, TickInterpolator) New/modified: - docs/migration-netfox-plan.md — migration architecture - scripts/network/network_manager.gd — netfox-aware ENet fallback - scripts/network/player.gd — clean base player - client/characters/player_netfox.gd — rollback player w/ WeaponManager - client/characters/input/player_net_input.gd — BaseNetInput subclass - client/characters/character/fps_character_controller.gd — netfox input feed - client/weapons/ — weapon data, registry, TacticalWeaponHitscan, WeaponManager - client/scripts/round_replicator.gd — client-side round state bridge - server/scripts/round_manager.gd — improved state machine - server/scripts/plugin_api/plugin_manager.gd — refined plugin system - config: enemy_tag, ally_tag for meatball targeting Removed: old C++ SimulationServer GDExtension (replaced by netfox rollback)
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
import inspect
|
|
import logging
|
|
import sys
|
|
|
|
from . import monkey
|
|
|
|
import distutils.log
|
|
|
|
|
|
def _not_warning(record):
|
|
return record.levelno < logging.WARNING
|
|
|
|
|
|
def configure() -> None:
|
|
"""
|
|
Configure logging to emit warning and above to stderr
|
|
and everything else to stdout. This behavior is provided
|
|
for compatibility with distutils.log but may change in
|
|
the future.
|
|
"""
|
|
err_handler = logging.StreamHandler()
|
|
err_handler.setLevel(logging.WARNING)
|
|
out_handler = logging.StreamHandler(sys.stdout)
|
|
out_handler.addFilter(_not_warning)
|
|
handlers = err_handler, out_handler
|
|
logging.basicConfig(
|
|
format="{message}", style='{', handlers=handlers, level=logging.DEBUG
|
|
)
|
|
if inspect.ismodule(distutils.dist.log):
|
|
monkey.patch_func(set_threshold, distutils.log, 'set_threshold')
|
|
# For some reason `distutils.log` module is getting cached in `distutils.dist`
|
|
# and then loaded again when patched,
|
|
# implying: id(distutils.log) != id(distutils.dist.log).
|
|
# Make sure the same module object is used everywhere:
|
|
distutils.dist.log = distutils.log
|
|
|
|
|
|
def set_threshold(level: int) -> int:
|
|
logging.root.setLevel(level * 10)
|
|
return set_threshold.unpatched(level)
|