Add a reload add-hoc command
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#include <config/config.hpp>
|
||||
#include <logger/logger.hpp>
|
||||
|
||||
void reload_process()
|
||||
{
|
||||
// Closing the config will just force it to be reopened the next time
|
||||
// a configuration option is needed
|
||||
Config::close();
|
||||
// Destroy the logger instance, to be recreated the next time a log
|
||||
// line needs to be written
|
||||
Logger::instance().reset();
|
||||
log_debug("Configuration and logger reloaded.");
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef RELOAD_HPP_INCLUDED
|
||||
#define RELOAD_HPP_INCLUDED
|
||||
|
||||
/**
|
||||
* Reload the server's configuration, and close the logger (so that it
|
||||
* closes its files etc, to take into account the new configuration)
|
||||
*/
|
||||
void reload_process();
|
||||
|
||||
#endif /* RELOAD_HPP_INCLUDED */
|
||||
Reference in New Issue
Block a user