[Asterisk-code-review] func_logic: Don't emit warning if both IF branches are empty. (asterisk[master])

N A asteriskteam at digium.com
Wed Sep 21 18:18:57 CDT 2022


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19307 )


Change subject: func_logic: Don't emit warning if both IF branches are empty.
......................................................................

func_logic: Don't emit warning if both IF branches are empty.

The IF function currently emits warnings if both IF branches
are empty. However, there is no actual necessity that either
branch be non-empty as, unlike other conditional applications/
functions, nothing is inherently done with IF, and both
sides could legitimately be empty. The warning is thus turned
into a debug message.

ASTERISK-30243 #close

Change-Id: I5250625dd720f95e1859b5dfb933905d7e7a730e
---
M funcs/func_logic.c
1 file changed, 19 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/07/19307/1

diff --git a/funcs/func_logic.c b/funcs/func_logic.c
index e62ae54..b1411f2 100644
--- a/funcs/func_logic.c
+++ b/funcs/func_logic.c
@@ -187,8 +187,7 @@
 	AST_NONSTANDARD_APP_ARGS(args2, args1.remainder, ':');
 
 	if (ast_strlen_zero(args1.expr) || !(args2.iftrue || args2.iffalse)) {
-		ast_log(LOG_WARNING, "Syntax IF(<expr>?[<true>][:<false>])  (expr must be non-null, and either <true> or <false> must be non-null)\n");
-		ast_log(LOG_WARNING, "      In this case, <expr>='%s', <true>='%s', and <false>='%s'\n", args1.expr, args2.iftrue, args2.iffalse);
+		ast_debug(1, "<expr>='%s', <true>='%s', and <false>='%s'\n", args1.expr, args2.iftrue, args2.iffalse);
 		return -1;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19307
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I5250625dd720f95e1859b5dfb933905d7e7a730e
Gerrit-Change-Number: 19307
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220921/c11f56e9/attachment.html>


More information about the asterisk-code-review mailing list