Helkar 385 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 Share this post Link to post Short link Share on other sites
vizhu 69 #269756 Posted May 11, 2015 ДА .. ну наконец то !! Quote Share this post Link to post Short link Share on other sites
OlliN 13 #269877 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 Share this post Link to post Short link Share on other sites
Helkar 385 #269955 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 Share this post Link to post Short link Share on other sites
ADv 10 #284434 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 Share this post Link to post Short link Share on other sites
Helkar 385 #284437 Posted July 24, 2015 Мод работает с последними версиями игры? думаю да, а разве он еще актуален? вроде спама в лог уже нет. Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #284515 Posted July 24, 2015 думаю да, а разве он еще актуален? вроде спама в лог уже нет. выпадает редко Quote Share this post Link to post Short link Share on other sites