]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
logger.c: Move LOG_GROUP documentation to dedicated XML file.
authorSean Bright <sean@seanbright.com>
Fri, 1 Dec 2023 17:03:29 +0000 (12:03 -0500)
committerSean Bright <sean@seanbright.com>
Wed, 6 Dec 2023 21:23:50 +0000 (21:23 +0000)
The `get_documentation` awk script will only extract the first
DOCUMENTATION block that it finds in a given file. This is by design
(9bc2127) to prevent AMI event documentation from being pulled in to
the core.xml documentation file.

Because of this, the `LOG_GROUP` documentation added in 89709e2 was
not being properly extracted and was missing fom the resulting XML
documentation file. This commit moves the `LOG_GROUP` documentation to
a separate `logger.xml` file.

main/logger.c
main/logger.xml [new file with mode: 0644]

index 60f464c8a8972ca40bd1c73cce55d23cf0235c84..c460e91cf4942dd3e4ac01aba24be3378855340b 100644 (file)
@@ -1776,41 +1776,6 @@ static int callid_logging_enabled(void)
        return cgl ? 1 : 0; /* If found, enabled, otherwise not */
 }
 
-/*** DOCUMENTATION
-       <function name="LOG_GROUP" language="en_US">
-               <synopsis>
-                       Set the channel group name for log filtering on this channel
-               </synopsis>
-               <syntax>
-                       <parameter name="group" required="false">
-                               <para>Channel log group name. Leave empty to remove any existing group membership.</para>
-                               <para>You can use any arbitrary alphanumeric name that can then be used by the
-                               "logger filter changroup" CLI command to filter dialplan output by group name.</para>
-                       </parameter>
-               </syntax>
-               <description>
-                       <para>Assign a channel to a group for log filtering.</para>
-                       <para>Because this application can result in dialplan execution logs
-                       being suppressed (or unsuppressed) from the CLI if filtering is active,
-                       it is recommended to call this as soon as possible when dialplan execution begins.</para>
-                       <para>Calling this multiple times will replace any previous group assignment.</para>
-                       <example title="Associate channel with group test">
-                       exten => s,1,Set(LOG_GROUP()=test)
-                               same => n,NoOp() ; if a logging call ID group filter name is enabled but test is not included, you will not see this
-                       </example>
-                       <example title="Associate channel with group important">
-                       exten => s,1,Set(LOG_GROUP()=important)
-                               same => n,Set(foo=bar) ; do some important things to show on the CLI (assuming it is filtered with important enabled)
-                               same => n,Set(LOG_GROUP()=) ; remove from group important to stop showing execution on the CLI
-                               same => n,Wait(5) ; do some unimportant stuff
-                       </example>
-               </description>
-               <see-also>
-                       <ref type="application">Log</ref>
-               </see-also>
-       </function>
- ***/
-
 static int log_group_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
 {
        int res = callid_set_chanloggroup(value);
diff --git a/main/logger.xml b/main/logger.xml
new file mode 100644 (file)
index 0000000..fa4ddff
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE docs SYSTEM "appdocsxml.dtd">
+<?xml-stylesheet type="text/xsl" href="appdocsxml.xslt"?>
+<docs xmlns:xi="http://www.w3.org/2001/XInclude">
+       <function name="LOG_GROUP" language="en_US">
+               <synopsis>
+                       Set the channel group name for log filtering on this channel
+               </synopsis>
+               <syntax>
+                       <parameter name="group" required="false">
+                               <para>Channel log group name. Leave empty to remove any existing group membership.</para>
+                               <para>You can use any arbitrary alphanumeric name that can then be used by the
+                               "logger filter changroup" CLI command to filter dialplan output by group name.</para>
+                       </parameter>
+               </syntax>
+               <description>
+                       <para>Assign a channel to a group for log filtering.</para>
+                       <para>Because this application can result in dialplan execution logs
+                       being suppressed (or unsuppressed) from the CLI if filtering is active,
+                       it is recommended to call this as soon as possible when dialplan execution begins.</para>
+                       <para>Calling this multiple times will replace any previous group assignment.</para>
+                       <example title="Associate channel with group test">
+                       exten => s,1,Set(LOG_GROUP()=test)
+                               same => n,NoOp() ; if a logging call ID group filter name is enabled but test is not included, you will not see this
+                       </example>
+                       <example title="Associate channel with group important">
+                       exten => s,1,Set(LOG_GROUP()=important)
+                               same => n,Set(foo=bar) ; do some important things to show on the CLI (assuming it is filtered with important enabled)
+                               same => n,Set(LOG_GROUP()=) ; remove from group important to stop showing execution on the CLI
+                               same => n,Wait(5) ; do some unimportant stuff
+                       </example>
+               </description>
+               <see-also>
+                       <ref type="application">Log</ref>
+               </see-also>
+       </function>
+</docs>