mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 06:07:11 -05:00
* adds log module * enable logging in the app * adds a getLogger method to AddonManager * change log level depending on ANKIDEV * fix undefined module variable * - fix addons log file path - remove a breakpoint leftover set the addons log files under pm.addonFolder()/NNNNNN/user_files/logs/NNNNNN.log * fix path bug * move log closing handling into AddonManager deleteAddon/backupUserFiles methods * logging module level import fix undefined variable in backupUserFiles * pretty format log records * move MediaServer log into logging * update CONTRIBUTORS * documentation cleanup * capture warnings into log messages fix waitress verbosity * remove record_factory function * add get_logger method alias to getLogger in AddonManager switch to TimedRotatingFileHandler handler fix minor typo * set main log level to DEBUG if ANKIDEV is not 0 (or unset) added two new methods to AddonManager addon_get_logger/addon_toggle_log_level * add new find_logger_output to AddonManager * move logs under pm.base * change log output * update addonmanager getlogger * Format imports * Refactor logging set-up slightly and tweak docstring * Remove obsolete log closing statements As logs are no longer stored in user_files, we do not need to close their handlers * Refactor and try to simplify log module * Remove demo code * Refactor and update add-on manager logging API * Simplify writing unit tests for add-ons that use logging Loggers are likely to be also employed in non UI code, so it seems like a good idea to decouple them from requiring a running Anki instance to work (thus freeing add-on authors from the need to mock Anki APIs in their tests). * Fix arguments and drop obsolete inline instructions Lets add a section on logging to the add-on docs instead * Drop unnecessary import * Supply logging basicConfig force option by default Until we change the module import order and thus ensure that `log` is always evaluated before third-party dependencies have a chance to initialize the root logger, `force` is non-optional. * Fix formatting and type errors * Restore mediasrv type ignore comments * Add note on prefix API stability * Consistently use addon_from_module in new code * Use logFolder rather than profileFolder * Adjust method name for PEP8 * Change loggerDict access path, satisfying pylint * Drop unused import and use lazy % formatting * lint fix * refactor .log_folder -> .addon_logs store anki.log under logdir * Fix method name (dae) * Disable file-based logging in the backend (dae) I have never found this useful, and it logs nothing by default, so creating/opening the file is a waste. Removing it also ensures that addon_logs() is solely used for add-ons. --------- Co-authored-by: Glutanimate <5459332+glutanimate@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| browser | ||
| data | ||
| forms | ||
| import_export | ||
| operations | ||
| qt | ||
| __init__.py | ||
| _macos_helper.py | ||
| about.py | ||
| addcards.py | ||
| addons.py | ||
| changenotetype.py | ||
| clayout.py | ||
| colors.py | ||
| customstudy.py | ||
| dbcheck.py | ||
| debug_console.py | ||
| deckbrowser.py | ||
| deckchooser.py | ||
| deckconf.py | ||
| deckdescription.py | ||
| deckoptions.py | ||
| editcurrent.py | ||
| editor.py | ||
| emptycards.py | ||
| errors.py | ||
| exporting.py | ||
| fields.py | ||
| filtered_deck.py | ||
| flags.py | ||
| gui_hooks.py | ||
| importing.py | ||
| legacy.py | ||
| log.py | ||
| main.py | ||
| mediacheck.py | ||
| mediasrv.py | ||
| mediasync.py | ||
| modelchooser.py | ||
| models.py | ||
| mpv.py | ||
| notetypechooser.py | ||
| overview.py | ||
| package.py | ||
| preferences.py | ||
| profiles.py | ||
| progress.py | ||
| props.py | ||
| py.typed | ||
| reviewer.py | ||
| schema_change_tracker.py | ||
| sound.py | ||
| stats.py | ||
| studydeck.py | ||
| stylesheets.py | ||
| switch.py | ||
| sync.py | ||
| tagedit.py | ||
| taglimit.py | ||
| taskman.py | ||
| theme.py | ||
| toolbar.py | ||
| tts.py | ||
| undo.py | ||
| update.py | ||
| utils.py | ||
| webview.py | ||
| widgetgallery.py | ||
| winpaths.py | ||