* modify config to use identifier data class and update json driver
* move identifier data attributes into read only properties
* Update mongo get and set methods
* Update get/set to use UUID separately, make clear work
* Remove not implemented and fix get_raw
* Update remaining untouched get/set/clear
* Fix get_raw
* Finally fix get_raw and set_raw
* style
* This is better
* Sorry guys
* Update get behavior to handle "all" calls as expected
* style again
* Why do you do this to me
* style once more
* Update mongo schema
* Logging enhancements and cleanup
- Removed debug log messages every time `Config.get_conf` is used or a JSON file is read/saved. The basic configuration is now logged once with DEBUG when the bot starts up instead.
- Changed logging output format to reverse date order, include seconds, and use the logger's name instead of the module, function and line number.
- Log files are now kept in the `DATAPATH/core/logs` directory. Each time Red is restarted, a new log is created, and the old ones renamed in a rotating fashion. There can be a maximum of 9 logs in total.
- Each log file now has a smaller max size of 500KB before it will be split into multiple parts. There are also a maximum of 9 parts of each log.
- Discord.py logger now uses the same output formatter as red's loggers
- Moved logging setup code into `redbot.logging` module.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Reformat
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Implement discussed changes
- We maintain a red.log over multiple runtimes, alongside a latest.log and previous.log for individual runtimes.
- Naming convention changed a bit. E.g. when latest.log is just one part, it will be named latest.log. When it becomes two parts, they will both be named latest-part1.log and latest-part2.log.
- Rotation direction is reversed. This means as the files end up being named in chronological order.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
Renames the `current_build` key to `current_version`. This means the `current_version` key will always be a dict and never a list, and `current_build` having no defaults means it won't mess with `[p]audioset settings`.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This is a step towards a more consistent front-end behaviour of Config, where errors are either circumvented or raised in the same way regardless of the driver being used.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Make calling groups useful
This makes config.Group.__call__ effectively an alias for Group.all(),
with the added bonus of becoming a context manager.
get_raw has been updated as well to reflect the new behaviour of
__call__.
* Fix unintended side-effects of new behaviour
* Add tests
* Add test for get_raw mixing in defaults
* Another cleanup for relying on old behaviour internally
* Fix bank relying on old behaviour
* Reformat
* [V3 JSON] Return deepcopy in JSON driver
* Add a test
* foo not bar
* Add a test for setting and then mutating
* Resolve issue for setting and mutating as well
* Reformat
* Cleanup quotes in cogs
* More quote cleanup that I missed
fixed a little bit of grammar here and there as well.
* [V3 Warnings] Change allowcustomreasons docstring
To help not confuse users who would believe that the command would use allow or disallow.
* Run black reformat
* Upgrade sphinx version to 1.7+
* Fix title overlines/underlines in autostart_systemd.rst
* Skip trying to document a method from discord.py
* Add escaped space after backtick
* Escape underscores (sphinx tries to interpret a hyperlink)
* Use fully qualified reference for class
* Fix reference in tunnel.py
* Remove python syntax highlighting in data_converter.py
For some reason sphinx couldn't lex these as python. Removing the highlighting seems like the logical solution for now, since if it wasn't being lexed, it wouldn't highlight anyway.
* Comment out static path since we're not using it right now
* Update sphinx version in docs requirements too
Would rather remove this duplication but RTD is a special snowflake
* Add the identifier as an initialization parameter
* Remove config object singleton and opt for a shared JSON datastore
* Fix bot unloading to deal with memory leaks
* Fix tests
* Fix clear all bug
* Add get_raw/set_raw
* Add default to get_raw
* Add custom group method to the config object
* Add more methods for custom groups
* Add some docstrings
* Deepcopy the result of get_raw, throw TypeError if no value is passed to set_raw
* Do it right..
* Better way to require kwarg
* Remove get_driver
* Rename self.driver to self._driver
* Do not unnecessarily pass the cog identifier
* Remove unused import
* Fix type annotation
* Missed a keyword rename
* Modify signature of get/set methods in drivers
* Basic Mongo Driver
* Update docstrings
* WIP motor support
* Use motor
* Update docs, add selective importer
* Make use of selective importer
* Fix docs
* Fix config storage location for JSON
* Add delimiters in the drivers doc section
* Make async things async
* Add basic config information for mongo driver
* get info from basic setup into config
* IT WORKS
* Add dependency for RJM's PR.
* Added alternative to all_from_kind
* Returned dicts include default values
Also added docstrings
Also removed all_globals since it's kind of redundant and it wasn't working out for me
* Refactored clear_all
* Tests
* Tests again..
* Make all new methods coroutines
Ya'll are gonna hate me.
* Initial modifications
* Add initial setup.py
* working setup py help
* Modify setup file to package stuff
* Move a bunch of shit and fix imports
* Fix or skip tests
* Must add init files for find_packages to work
* Move main to scripts folder and rename
* Add shebangs
* Copy over translation files
* WORKING PIP INSTALL
* add dependency information
* Hardcoded version for now, will need to figure out a better way to do this
* OKAY ITS FINALLY FUCKING WORKING
* Add this guy
* Fix stuff
* Change readme to rst
* Remove double sentry opt in
* Oopsie
* Fix this thing
* Aaaand fix test
* Aaaand fix test
* Fix core cog importing and default cog install path
* Adjust readme
* change instance name from optional to required
* Ayyy let's do more dependency injection