Motion-Project / motion

Motion, a software motion detector. Home page: https://motion-project.github.io/
GNU General Public License v2.0
3.59k stars 544 forks source link

Inconsistent logging timestamp #1777

Open tosiara opened 1 week ago

tosiara commented 1 week ago

Did you read the guide?

Yes

What is the base version number of Motion being used?

4.6.x

What was the install method?

Built from source code

What is base architecture?

x86

What is the distro being used?

Raspbian

Disto version number

22.04

Camera type(s) being used?

Network camera with RTSP

Describe the issue/problem and steps to reproduce

Timestamp in the log seems to be fixed width which causes seconds truncation on default Ubuntu installation with Lithuanian locale. The format changes at runtime:

[0:motion] [DBG] [DBL] [Jun 21 15:48:33] dbse_global_init: Initializing database
[0:motion] [NTC] [ALL] [birž. 21 15:48:] translate_init: Language: English

Would be great to force same time format across all the log and avoid truncation

Motion log output at log_level 8

[0:motion] [DBG] [STR] [Jun 21 15:48:33] webu_mhd_features_tls: SSL/TLS: available
[0:motion] [NTC] [STR] [Jun 21 15:48:33] webu_start_ctrl: Started webcontrol on port 8080
[0:motion] [NTC] [ENC] [Jun 21 15:48:33] ffmpeg_global_init: ffmpeg libavcodec version 58.134.100 libavformat version 58.76.100
[0:motion] [DBG] [DBL] [Jun 21 15:48:33] dbse_global_init: Initializing database
[0:motion] [NTC] [ALL] [birž. 21 15:48:] translate_init: Language: English
[0:motion] [NTC] [ALL] [birž. 21 15:48:] motion_start_thread: Camera ID: 0 is from motion-file.conf
[0:motion] [NTC] [ALL] [birž. 21 15:48:] motion_start_thread: Camera ID: 0 Camera Name: motion Service: file:
[0:motion] [NTC] [ALL] [birž. 21 15:48:] main: Waiting for threads to finish, pid: 504047
tosiara commented 1 week ago
$ env | grep LC
LC_ADDRESS=lt_LT.UTF-8
LC_NAME=lt_LT.UTF-8
LC_MONETARY=lt_LT.UTF-8
LC_PAPER=lt_LT.UTF-8
LC_IDENTIFICATION=lt_LT.UTF-8
LC_TELEPHONE=lt_LT.UTF-8
LC_MEASUREMENT=lt_LT.UTF-8
LC_TIME=lt_LT.UTF-8
LC_NUMERIC=lt_LT.UTF-8
Mr-Dave commented 6 days ago

Thanks. I understand the timestamp issue and length problem.

I'm also now curious as to whether the translations are even working properly. i.e. The timestamp was converted to Lithuanian but for some reason the message remained in English. I would have thought that either both would be in Lithuanian or both in English.

Do you see the native language translations of the messages?

tosiara commented 1 day ago

No, everything is in English. I actually never used translation, I'd like to have everything in English - both timestamp and messages