You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/11/04 19:14:30 UTC
[commons-daemon] branch master updated: Add support for a new log
level called Trace, lower-level than Debug.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git
The following commit(s) were added to refs/heads/master by this push:
new 930f405 Add support for a new log level called Trace, lower-level than Debug.
930f405 is described below
commit 930f40543c565d92b3addcdeecc2ceb3d25b49e1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Nov 4 15:14:27 2021 -0400
Add support for a new log level called Trace, lower-level than Debug.
---
src/changes/changes.xml | 3 +++
src/native/windows/include/log.h | 10 ++++++----
src/native/windows/src/log.c | 3 +++
src/site/xdoc/procrun.xml | 2 +-
4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e82c25b..9ac94fc 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -61,6 +61,9 @@
<action type="add" dev="ggregory" due-to="Gary Gregory">
reportServiceStatusE() shows a short description for dwCurrentState in logging.
</action>
+ <action type="add" dev="ggregory" due-to="Gary Gregory">
+ Add support for a new log level called Trace, lower-level than Debug.
+ </action>
<!-- -UPDATE -->
<action type="update" dev="ggregory" due-to="Dependabot">
Bump actions/cache from v2 to v2.1.6 #24, #30.
diff --git a/src/native/windows/include/log.h b/src/native/windows/include/log.h
index 118035b..05fac9f 100644
--- a/src/native/windows/include/log.h
+++ b/src/native/windows/include/log.h
@@ -48,15 +48,17 @@ __APXBEGIN_DECLS
LeaveCriticalSection(_pt_sys_loglock); \
else (void)0
-#define APXLOG_LEVEL_DEBUG 0
-#define APXLOG_LEVEL_INFO 1
-#define APXLOG_LEVEL_WARN 2
-#define APXLOG_LEVEL_ERROR 3
+#define APXLOG_LEVEL_TRACE 0
+#define APXLOG_LEVEL_DEBUG 1
+#define APXLOG_LEVEL_INFO 2
+#define APXLOG_LEVEL_WARN 3
+#define APXLOG_LEVEL_ERROR 4
#define APXLOG_MARK_INFO NULL, APXLOG_LEVEL_INFO, TRUE, __FILE__, __LINE__, ""
#define APXLOG_MARK_WARN NULL, APXLOG_LEVEL_WARN, TRUE, __FILE__, __LINE__, ""
#define APXLOG_MARK_ERROR NULL, APXLOG_LEVEL_ERROR, TRUE, __FILE__, __LINE__, ""
#define APXLOG_MARK_DEBUG NULL, APXLOG_LEVEL_DEBUG, TRUE, __FILE__, __LINE__, ""
+#define APXLOG_MARK_TRACE NULL, APXLOG_LEVEL_TRACE, TRUE, __FILE__, __LINE__, ""
#define APXLOG_MARK_RAW NULL, APXLOG_LEVEL_INFO, FALSE, NULL, 0,
#define APXLOG_MARK_SYSERR NULL, APXLOG_LEVEL_ERROR, TRUE, __FILE__, __LINE__, NULL
diff --git a/src/native/windows/src/log.c b/src/native/windows/src/log.c
index ea4240c..ddafe90 100644
--- a/src/native/windows/src/log.c
+++ b/src/native/windows/src/log.c
@@ -23,6 +23,7 @@
#define LOGF_EXR L".%04d-%02d-%02d.%02d%02d%02d.log"
static LPCSTR _log_level[] = {
+ "[trace] ",
"[debug] ",
"[info] ",
"[warn] ",
@@ -279,6 +280,8 @@ void apxLogLevelSetW(HANDLE hFile,
lf->dwLogLevel = APXLOG_LEVEL_INFO;
else if (!lstrcmpiW(szLevel, L"debug"))
lf->dwLogLevel = APXLOG_LEVEL_DEBUG;
+ else if (!lstrcmpiW(szLevel, L"trace"))
+ lf->dwLogLevel = APXLOG_LEVEL_TRACE;
}
}
diff --git a/src/site/xdoc/procrun.xml b/src/site/xdoc/procrun.xml
index 450f47f..2351455 100644
--- a/src/site/xdoc/procrun.xml
+++ b/src/site/xdoc/procrun.xml
@@ -546,7 +546,7 @@ will add the new value(s) to any existing value(s).
<td>--LogLevel</td>
<td>Info</td>
<td>Defines the logging level and can be either <b>Error</b>,
- <b>Info</b>, <b>Warn</b> or <b>Debug</b>. (Case insensitive).
+ <b>Info</b>, <b>Warn</b>, <b>Debug</b>, or <b>Trace</b>. (Case insensitive).
</td>
</tr>
<tr>