<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/lib/util/debug.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>lib:util:debug Logging macros for JSON output</title>
<updated>2026-01-28T23:29:39+00:00</updated>
<author>
<name>Gary Lockyer</name>
<email>gary@catalyst.net.nz</email>
</author>
<published>2026-01-22T20:25:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=3c30c4740f40f633b5a71c772374e6c1283ec13c'/>
<id>3c30c4740f40f633b5a71c772374e6c1283ec13c</id>
<content type='text'>
Add new debug macros for outputting JSON log lines

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15898

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add new debug macros for outputting JSON log lines

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15898

Signed-off-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib:util: Disable logging to syslog for startup messages</title>
<updated>2025-06-18T12:10:03+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2025-06-10T11:46:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=58c64ba25adb1c1d272ba196529b5465ae7ee9df'/>
<id>58c64ba25adb1c1d272ba196529b5465ae7ee9df</id>
<content type='text'>
D_ERR also is sent to syslog!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15869

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;

Autobuild-User(master): Andreas Schneider &lt;asn@cryptomilk.org&gt;
Autobuild-Date(master): Wed Jun 18 12:10:03 UTC 2025 on atb-devel-224
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
D_ERR also is sent to syslog!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15869

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;

Autobuild-User(master): Andreas Schneider &lt;asn@cryptomilk.org&gt;
Autobuild-Date(master): Wed Jun 18 12:10:03 UTC 2025 on atb-devel-224
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: Confine the copy_no_nl memcpy to debug_gpfs_log()</title>
<updated>2024-01-04T17:06:19+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2023-12-19T14:34:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=f2dbcea6f0499e81cf5b3215459925bb1dffd4a8'/>
<id>f2dbcea6f0499e81cf5b3215459925bb1dffd4a8</id>
<content type='text'>
gpfswrap_add_trace() seems not to have a format string that could
understand the %.*s notation.

While there this removes &gt;4k of r/w memory from every smbd.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;

Autobuild-User(master): Volker Lendecke &lt;vl@samba.org&gt;
Autobuild-Date(master): Thu Jan  4 17:06:19 UTC 2024 on atb-devel-224
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gpfswrap_add_trace() seems not to have a format string that could
understand the %.*s notation.

While there this removes &gt;4k of r/w memory from every smbd.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;

Autobuild-User(master): Volker Lendecke &lt;vl@samba.org&gt;
Autobuild-Date(master): Thu Jan  4 17:06:19 UTC 2024 on atb-devel-224
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: Avoid memcpy in debug_lttng_log()</title>
<updated>2024-01-04T16:03:36+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2023-12-19T13:47:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=c3399cd46f7a33db516b5716a2ce0ebf50fd117a'/>
<id>c3399cd46f7a33db516b5716a2ce0ebf50fd117a</id>
<content type='text'>
tracef() understands the %.*s format.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tracef() understands the %.*s format.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: Avoid memcpy in debug_systemd_log()</title>
<updated>2024-01-04T16:03:36+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2023-12-19T13:44:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=f8a75f830774a6f32ed834cd3d17ba8804fddb82'/>
<id>f8a75f830774a6f32ed834cd3d17ba8804fddb82</id>
<content type='text'>
sd_journal_send() understands the %.*s format.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sd_journal_send() understands the %.*s format.

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/util: add debug_set_forced_log_priority()</title>
<updated>2023-11-24T09:30:38+00:00</updated>
<author>
<name>Stefan Metzmacher</name>
<email>metze@samba.org</email>
</author>
<published>2023-11-22T16:03:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=bd21a0cdefb30ef5522f81d865c03d11a182a63c'/>
<id>bd21a0cdefb30ef5522f81d865c03d11a182a63c</id>
<content type='text'>
By default the priority for syslog/systemd is derived from
the log level of the debug message.

But for things like startup messages we want to
change the priority temporary, like this:

debug_set_forced_log_priority(DBGLVL_NOTICE);
D_ERR("Startup...\n");
debug_set_forced_log_priority(-1);

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15377

Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Björn Jacke &lt;bjacke@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By default the priority for syslog/systemd is derived from
the log level of the debug message.

But for things like startup messages we want to
change the priority temporary, like this:

debug_set_forced_log_priority(DBGLVL_NOTICE);
D_ERR("Startup...\n");
debug_set_forced_log_priority(-1);

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15377

Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Björn Jacke &lt;bjacke@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/util: Fix building with FORTIFY_SOURCE=2</title>
<updated>2023-10-01T22:45:38+00:00</updated>
<author>
<name>Joseph Sutton</name>
<email>josephsutton@catalyst.net.nz</email>
</author>
<published>2023-09-28T03:39:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=1f92b5f1501d59b6c186ac1446693c97a24c3db6'/>
<id>1f92b5f1501d59b6c186ac1446693c97a24c3db6</id>
<content type='text'>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>util: Avoid logging to multiple backends for stdout/stderr</title>
<updated>2023-08-28T01:21:07+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2023-07-26T10:43:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=c7672779128ff12eb7a5cb34052559e62adbd5cb'/>
<id>c7672779128ff12eb7a5cb34052559e62adbd5cb</id>
<content type='text'>
Commit 83fe7a0316d3e5867a56cfdc51ec17f36ea03889 converted the
stdout/stderr logging  types to DEBUG_FILE to get a header when using
DEBUG_SYSLOG_FORMAT_ALWAYS.  However, this causes all configured
backends to be invoked.  When syslog is one of those backends then
this is almost certainly not what is intended.

Instead, call debug_file_log() directly in that special case and
revert the parts of the above commit that convert to file logging.

Most of the changes to debughdrclass() still seem necessary, since
they handle the change of debug_syslog_format from a bool to an enum.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15460

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;

Autobuild-User(master): Martin Schwenke &lt;martins@samba.org&gt;
Autobuild-Date(master): Mon Aug 28 01:21:07 UTC 2023 on atb-devel-224
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 83fe7a0316d3e5867a56cfdc51ec17f36ea03889 converted the
stdout/stderr logging  types to DEBUG_FILE to get a header when using
DEBUG_SYSLOG_FORMAT_ALWAYS.  However, this causes all configured
backends to be invoked.  When syslog is one of those backends then
this is almost certainly not what is intended.

Instead, call debug_file_log() directly in that special case and
revert the parts of the above commit that convert to file logging.

Most of the changes to debughdrclass() still seem necessary, since
they handle the change of debug_syslog_format from a bool to an enum.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15460

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;

Autobuild-User(master): Martin Schwenke &lt;martins@samba.org&gt;
Autobuild-Date(master): Mon Aug 28 01:21:07 UTC 2023 on atb-devel-224
</pre>
</div>
</content>
</entry>
<entry>
<title>debug: Only initialize gpfs wrapper when gpfs logging is enabled</title>
<updated>2023-04-14T12:28:23+00:00</updated>
<author>
<name>Christof Schmitt</name>
<email>cs@samba.org</email>
</author>
<published>2023-04-13T18:13:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=45f026c45c996bb65d2bd3e350587d51d6862a03'/>
<id>45f026c45c996bb65d2bd3e350587d51d6862a03</id>
<content type='text'>
This avoids unnecessary attempts to load libgpfs.so when it is not
needed.

Signed-off-by: Christof Schmitt &lt;cs@samba.org&gt;
Reviewed-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;

Autobuild-User(master): Volker Lendecke &lt;vl@samba.org&gt;
Autobuild-Date(master): Fri Apr 14 12:28:23 UTC 2023 on atb-devel-224
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This avoids unnecessary attempts to load libgpfs.so when it is not
needed.

Signed-off-by: Christof Schmitt &lt;cs@samba.org&gt;
Reviewed-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;

Autobuild-User(master): Volker Lendecke &lt;vl@samba.org&gt;
Autobuild-Date(master): Fri Apr 14 12:28:23 UTC 2023 on atb-devel-224
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/util: Add "debug syslog format = always", which logs to stdout in syslog style</title>
<updated>2023-04-06T12:51:30+00:00</updated>
<author>
<name>Andrew Bartlett</name>
<email>abartlet@samba.org</email>
</author>
<published>2023-04-06T00:26:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=83fe7a0316d3e5867a56cfdc51ec17f36ea03889'/>
<id>83fe7a0316d3e5867a56cfdc51ec17f36ea03889</id>
<content type='text'>
Signed-off-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
