[Asterisk-code-review] ARI: Retrieve existing log channels (asterisk[13])
Ashley Sanders
asteriskteam at digium.com
Fri Aug 7 10:55:59 CDT 2015
Ashley Sanders has posted comments on this change.
Change subject: ARI: Retrieve existing log channels
......................................................................
Patch Set 9: Code-Review-1
(1 comment)
https://gerrit.asterisk.org/#/c/986/9/main/logger.c
File main/logger.c:
Line 939: int success = 0;
:
: struct ast_str *filename = ast_str_create(64);
: if (!filename) {
: return -1;
: }
:
: ast_str_append(&filename, 0, "%s/%s", ast_config_AST_LOG_DIR, log_channel);
:
: AST_RWLIST_WRLOCK(&logchannels);
:
: ast_mkdir(ast_config_AST_LOG_DIR, 0644);
:
: AST_RWLIST_TRAVERSE(&logchannels, f, list) {
: if (f->disabled) {
: f->disabled = 0; /* Re-enable logging at reload */
: manager_event(EVENT_FLAG_SYSTEM, "LogChannel", "Channel: %s\r\nEnabled: Yes\r\n",
: f->filename);
: }
: if (f->fileptr && (f->fileptr != stdout) && (f->fileptr != stderr)) {
: fclose(f->fileptr); /* Close file */
: f->fileptr = NULL;
: if (strcmp(ast_str_buffer(filename), f->filename) == 0) {
: rotate_file(f->filename);
: success = 1;
: }
: }
: }
:
: init_logger_chain(1 /* locked */, NULL);
:
: AST_RWLIST_UNLOCK(&logchannels);
: ast_free(filename);
:
: return success;
Convert these return values to use your new enum.
--
To view, visit https://gerrit.asterisk.org/986
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I7bb08b93e3b938c991f3f56cc5d188654768a808
Gerrit-PatchSet: 9
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Scott Emidy <jemidy at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Scott Emidy <jemidy at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list