Remove unwanted newline character at end of timestamp#3111
Remove unwanted newline character at end of timestamp#3111prsunny merged 3 commits intosonic-net:masterfrom
Conversation
|
Can this be caught by VS test? |
|
/azpw run Azure.sonic-swss |
|
/AzurePipelines run Azure.sonic-swss |
|
Azure Pipelines successfully started running 1 pipeline(s). |
160c9a4 to
9b68530
Compare
0608aba to
740340b
Compare
orchagent/portsorch.cpp
Outdated
| FieldValueTuple tuple("last_down_time", std::ctime(&now_c)); | ||
| char buffer[32]; | ||
| // Format: Www Mmm dd hh:mm:ss yyyy | ||
| std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::localtime(&now_c)); |
There was a problem hiding this comment.
@arista-nwolfe can we keep the time in UTC since the syslog event time is in UTC?
There was a problem hiding this comment.
Will do, note that previously it was already in local time with ctime
9127511 to
1bf7345
Compare
1bf7345 to
f6c3383
Compare
|
/azpw run Azure.sonic-swss |
|
/AzurePipelines run Azure.sonic-swss |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw run Azure.sonic-swss |
|
/AzurePipelines run Azure.sonic-swss |
|
Azure Pipelines successfully started running 1 pipeline(s). |
ccb19ba to
f2d6606
Compare
|
@prsunny, can you help merge this? |
|
@arista-nwolfe A backport to 202311 is needed to fix a regression caused by a backport of this PR: #3052 Can you add a |
I don't have label permissions @wenyiz2021 @arlakshm @vmittal-msft would one of you be able to add it. |
|
hi @arista-nwolfe could you run test with 202311 for the cherrypick? |
|
@yxieca could you help to cherry pick? |
Tested this on 202311 |
* Remove unwanted newline character at end of timestamp * Cleaner approach to generate timestamp string with no newline character * Use UTC rather than local time in timestamp
|
Cherry-pick PR to 202311: #3256 |
* Remove unwanted newline character at end of timestamp * Cleaner approach to generate timestamp string with no newline character * Use UTC rather than local time in timestamp
* Remove unwanted newline character at end of timestamp * Cleaner approach to generate timestamp string with no newline character * Use UTC rather than local time in timestamp
In #3052 2 new fields were added the
PORT_TABLEinAPPL_DB:last_down_timeandlast_up_time.But their value was generated with
std::ctimewhich includes a newline character at the end of the character array which causes issues for parsing the output.Output today:
Output after this change: