aboutsummaryrefslogtreecommitdiffstats
path: root/main/logger.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-06 14:23:12 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-06 14:23:12 +0000
commit4f471e1f713f2ec7e859a71b2b20984b131f3594 (patch)
tree4d7ecd11f84e8361939137cb74d73daa7942d2d9 /main/logger.c
parent21f8732bd345adeb6989ab64baf38b7b90b862b4 (diff)
Merged revisions 91366 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r91366 | oej | 2007-12-06 13:54:11 +0100 (Tor, 06 Dec 2007) | 4 lines Make sure logger is reloaded at general reload in the cli. (Discovered during Asterisk training in Portugal) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91384 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/logger.c')
-rw-r--r--main/logger.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/main/logger.c b/main/logger.c
index cf994a549..00fbdaecd 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -616,6 +616,15 @@ static int reload_logger(int rotate)
return res;
}
+/*! \brief Reload the logger module without rotating log files (also used from loader.c during
+ a full Asterisk reload) */
+int logger_reload(void)
+{
+ if(reload_logger(0))
+ return RESULT_FAILURE;
+ return RESULT_SUCCESS;
+}
+
static char *handle_logger_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -631,8 +640,8 @@ static char *handle_logger_reload(struct ast_cli_entry *e, int cmd, struct ast_c
if (reload_logger(0)) {
ast_cli(a->fd, "Failed to reload the logger\n");
return CLI_FAILURE;
- } else
- return CLI_SUCCESS;
+ }
+ return CLI_SUCCESS;
}
static char *handle_logger_rotate(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -650,8 +659,8 @@ static char *handle_logger_rotate(struct ast_cli_entry *e, int cmd, struct ast_c
if (reload_logger(1)) {
ast_cli(a->fd, "Failed to reload the logger and rotate log files\n");
return CLI_FAILURE;
- } else
- return CLI_SUCCESS;
+ }
+ return CLI_SUCCESS;
}
/*! \brief CLI command to show logging system configuration */