pkarashchenko commented on issue #1153: URL: https://github.com/apache/incubator-nuttx-apps/issues/1153#issuecomment-1107467274
I think for telnet log it should be enough just to "syslog_file_channel(session->ts_devpath)", but you will need to configure "CONFIG_SYSLOG_FILE_ROTATIONS=0" and "CONFIG_SYSLOG_FILE_SEPARATE=n". There will be no need for additional lock in telnet_write because syslog_dev layer already contain "ret = syslog_dev_takesem(syslog_dev);" and should be sufficient to be used with multiple tasks. But the messages output may be still messed up because upper layer does not lock at message boundary, but only ensures that lower level writes are protected. But still that is again the same as with UART logging. And also I would agree that ramlog is a good alternative. сб, 23 квіт. 2022 р. о 12:01 Xiang Xiao ***@***.***> пише: > Here is the background: I have a dev-board which has limited number of > pins. So I have to disable CONFIG_NSH_CONSOLE and use all the pins for > other purposes. I have disabled it and booted the system, the system runs > and gives the expected results(can be examined by detecting PWM or other > peripheral output). However, it is still painful without log output, so I > want to redirect all syslog output to telnet. > > After some thinking, I think one solution is: > > 1. Create a syslog channel when telnet_session is created. The code > may be something like: > > int syslog_telnet_channel(FAR struct telnet_session_s *session) > { > g_syslog_telnet_channel = syslog_dev_initialize(session->ts_devpath, // will be the same name as telnet device, > OPEN_FLAGS, OPEN_MODE); > if (g_syslog_telnet_channel == NULL) > { > return -ENOMEM; > } > > return syslog_channel(g_syslog_telnet_channel ); > } > > > 1. Also need to add lock mechanism in telnet_write, it will be called > from different task now > > Is this the right way? > > This solution can't handle the log from interrupt or panic. Why not use > ramlog? > > — > Reply to this email directly, view it on GitHub > <https://github.com/apache/incubator-nuttx-apps/issues/1153#issuecomment-1107445241>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AEHCOCIHD7XACFRC7HJFEBLVGPC7JANCNFSM5UCOH2VA> > . > You are receiving this because you are subscribed to this thread.Message > ID: ***@***.***> > -- 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. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org