Helkar Posted May 11, 2015 Share Posted May 11, 2015 (edited) удаляет спам таких сообщений: NOTICE: [NOTE] (scripts/client/Avatar.py, 1030): [INIT_STEPS] Avatar.vehicle_onEnterWorld код мода: filter_arr = [ '[INIT_STEPS]' ] try: from ResMgr import resolveToAbsolutePath config_path = resolveToAbsolutePath('scripts/client/mods/log_filter.txt') with open(config_path) as config_file: for filter in config_file.read().splitlines(): if filter: filter_arr.append(filter) except: print 'log_filter: problem with config file, using default' def clean_doLog(base, category, msg, args = None): for filter in filter_arr: if msg.find(filter) >= 0: return base(category, msg, args) def _RegisterEvents(): import debug_utils from xfw import OverrideMethod OverrideMethod(debug_utils, '_doLog', clean_doLog) import BigWorld BigWorld.callback(0, _RegisterEvents) в прилагающемся текстовом файле можно задать дополнительный список текстов по которым будет производиться фильтрация. для работы нужен XVM. файлы ложить в res_mods\0.9.7\scripts\client\mods log_filter.rar Edited May 12, 2015 by Helkar 7 @ Quote Link to comment Short link Share on other sites More sharing options...
vizhu Posted May 11, 2015 Share Posted May 11, 2015 ДА .. ну наконец то !! @ Quote Link to comment Short link Share on other sites More sharing options...
OlliN Posted May 11, 2015 Share Posted May 11, 2015 Well done. How about exporting the filter to a customizable XML file and then let the script filter other types of log messages as well? E.g. a filter 'log_filter' will prevent 'INFO: Load mods: log_filter' from appearing in the log. @ Quote Link to comment Short link Share on other sites More sharing options...
Helkar Posted May 12, 2015 Author Share Posted May 12, 2015 Well done. How about exporting the filter to a customizable XML file and then let the script filter other types of log messages as well? E.g. a filter 'log_filter' will prevent 'INFO: Load mods: log_filter' from appearing in the log. i've updated the first post to support custom filtering. however, the mod only filters what is written via this function: debug_utils._doLog, which meens such things 'INFO: Load mods: log_filter' will not by filtered 1 @ Quote Link to comment Short link Share on other sites More sharing options...
ADv Posted July 24, 2015 Share Posted July 24, 2015 i've updated the first post to support custom filtering. however, the mod only filters what is written via this function: debug_utils._doLog, which meens such things 'INFO: Load mods: log_filter' will not by filtered Мод работает с последними версиями игры? @ Quote Link to comment Short link Share on other sites More sharing options...
Helkar Posted July 24, 2015 Author Share Posted July 24, 2015 Мод работает с последними версиями игры? думаю да, а разве он еще актуален? вроде спама в лог уже нет. @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted July 24, 2015 Share Posted July 24, 2015 думаю да, а разве он еще актуален? вроде спама в лог уже нет. выпадает редко @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.