hideakitai / DebugLog

Logging library for Arduino that can output to both Serial and File with one line
MIT License
51 stars 12 forks source link

Strange behavior log in two serial data ports events #3

Closed kost-samsonov closed 4 years ago

kost-samsonov commented 4 years ago

When a log is output from two serial data ports events, the data is mixed and partially discarded. Example log 2020-10-15 12:56:57.250|VERBOSE|CommandProcessor.cpp|65|Execute|cmd:T02020-10-15 12:56:57.256|VERBOSE|TATransport.cpp|250|RetranslatePSCommand|Enter

The expected log 2020-10-15 12:56:57.250|VERBOSE|TATransport.cpp|171|SeparatePCCommands|Enter 2020-10-15 12:56:57.256|VERBOSE|CommandProcessor.cpp|65|Execute|cmd:T01,

hideakitai commented 4 years ago

Hi, do you mean switching attach() in two serial events? If so, it is correct behavior. (Because DebugLog::Manager is singleton). You should use only one serial port to logger.

You can use LOG_XXXX from anywhere if you include DebugLog :-) If you have any questions, please re-open (or just comment to) the issue!