You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/10 20:29:15 UTC
[GitHub] [incubator-nuttx] v01d opened a new pull request #3020: syslog: add option to prefix process name
v01d opened a new pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020
## Summary
Add support for printing process name as a prefix to syslog message, which is more declarative than PID. Output looks like:
```
[ 0.000000] [NOTICE] drive_controller: motors disabled
[ 0.000000] [ DEBUG] robot: started
[ 0.000000] [ DEBUG] drive_controller: started
```
## Impact
Add feature.
## Testing
Custom config.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] v01d commented on a change in pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020#discussion_r591904317
##########
File path: drivers/syslog/vsyslog.c
##########
@@ -212,6 +213,15 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
ret += lib_sprintf(&stream.public, "%s", CONFIG_SYSLOG_PREFIX_STRING);
#endif
+#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_SYSLOG_PROCESS_NAME)
+ /* Pre-pend the Process ID */
Review comment:
Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020#discussion_r591902498
##########
File path: drivers/syslog/vsyslog.c
##########
@@ -212,6 +213,15 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
ret += lib_sprintf(&stream.public, "%s", CONFIG_SYSLOG_PREFIX_STRING);
#endif
+#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_SYSLOG_PROCESS_NAME)
+ /* Pre-pend the Process ID */
Review comment:
```suggestion
/* Prepend the Process ID */
```
Please, could you fix this typo? It is repeated several times in this file.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] acassis merged pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
acassis merged pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] v01d commented on pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
v01d commented on pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020#issuecomment-797094919
It is good on my end.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020#discussion_r592029463
##########
File path: drivers/syslog/vsyslog.c
##########
@@ -67,6 +67,7 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
{
struct lib_syslogstream_s stream;
int ret;
+ struct tcb_s *tcb;
Review comment:
```suggestion
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_SYSLOG_PROCESS_NAME)
struct tcb_s *tcb;
#endif
```
and remove line 221-222, since time/tm variable work this way.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] acassis commented on pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020#issuecomment-797098025
Done! Thank you!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] v01d commented on a change in pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020#discussion_r592676233
##########
File path: drivers/syslog/vsyslog.c
##########
@@ -67,6 +67,7 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
{
struct lib_syslogstream_s stream;
int ret;
+ struct tcb_s *tcb;
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020#discussion_r591905257
##########
File path: drivers/syslog/vsyslog.c
##########
@@ -201,17 +202,26 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
#endif
#if defined(CONFIG_SYSLOG_PRIORITY)
- /* Pre-pend the message priority. */
+ /* Prepend the message priority. */
ret += lib_sprintf(&stream.public, "[%6s] ", g_priority_str[priority]);
#endif
#if defined(CONFIG_SYSLOG_PREFIX)
- /* Pre-pend the prefix, if available */
+ /* Prepend the prefix, if available */
ret += lib_sprintf(&stream.public, "%s", CONFIG_SYSLOG_PREFIX_STRING);
#endif
+#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_SYSLOG_PROCESS_NAME)
+ /* Prepend the Process ID */
Review comment:
```suggestion
/* Prepend the Process name */
```
I tried to update my previous comment, but you were quicker on the force-push hehe.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] v01d commented on a change in pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
v01d commented on a change in pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020#discussion_r591905901
##########
File path: drivers/syslog/vsyslog.c
##########
@@ -201,17 +202,26 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
#endif
#if defined(CONFIG_SYSLOG_PRIORITY)
- /* Pre-pend the message priority. */
+ /* Prepend the message priority. */
ret += lib_sprintf(&stream.public, "[%6s] ", g_priority_str[priority]);
#endif
#if defined(CONFIG_SYSLOG_PREFIX)
- /* Pre-pend the prefix, if available */
+ /* Prepend the prefix, if available */
ret += lib_sprintf(&stream.public, "%s", CONFIG_SYSLOG_PREFIX_STRING);
#endif
+#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_SYSLOG_PROCESS_NAME)
+ /* Prepend the Process ID */
Review comment:
Np. Fixed as well.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] acassis commented on pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020#issuecomment-797094624
@v01d and @xiaoxiang781216 should we merge now?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #3020: syslog: add option to prefix process name
Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #3020:
URL: https://github.com/apache/incubator-nuttx/pull/3020#discussion_r591902498
##########
File path: drivers/syslog/vsyslog.c
##########
@@ -212,6 +213,15 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
ret += lib_sprintf(&stream.public, "%s", CONFIG_SYSLOG_PREFIX_STRING);
#endif
+#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_SYSLOG_PROCESS_NAME)
+ /* Pre-pend the Process ID */
Review comment:
```suggestion
/* Prepend the Process name */
```
Please, could you fix this typo? It is repeated several times in this file.
Also, changed ID to name.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org