Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit bdfac1e

Browse files
committed
improve logging
1 parent b61846e commit bdfac1e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

synapse/handlers/auth.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# limitations under the License.
1616

1717
import logging
18+
import time
1819
import unicodedata
1920

2021
import attr
@@ -579,7 +580,13 @@ def get_access_token_for_user_id(self, user_id, device_id, valid_until_ms):
579580
Raises:
580581
StoreError if there was a problem storing the token.
581582
"""
582-
logger.info("Logging in user %s on device %s", user_id, device_id)
583+
fmt_expiry = ""
584+
if valid_until_ms is not None:
585+
fmt_expiry = time.strftime(
586+
"until %Y-%m-%d %H:%M:%S", time.localtime(valid_until_ms / 1000.0)
587+
)
588+
logger.info("Logging in user %s on device %s%s", user_id, device_id, fmt_expiry)
589+
583590
yield self.auth.check_auth_blocking(user_id)
584591

585592
access_token = self.macaroon_gen.generate_access_token(user_id)

0 commit comments

Comments
 (0)