Challenge: Secure Logging
Aufgabe
Swipe to start coding
Write a function that logs user actions without exposing sensitive information. Your function must ensure that no secrets or personal data are included in the logs.
- Remove any key-value pairs from the
detailsdictionary whose key matches'password','ssn','credit_card', or'secret'. - Create a log message that includes the
user_id,action, and the filtered details. - Log the message using the
loggingmodule. - Return the log message as a string.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 2. Kapitel 5
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Awesome!
Completion rate improved to 5.56
Challenge: Secure Logging
Swipe um das Menü anzuzeigen
Aufgabe
Swipe to start coding
Write a function that logs user actions without exposing sensitive information. Your function must ensure that no secrets or personal data are included in the logs.
- Remove any key-value pairs from the
detailsdictionary whose key matches'password','ssn','credit_card', or'secret'. - Create a log message that includes the
user_id,action, and the filtered details. - Log the message using the
loggingmodule. - Return the log message as a string.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 2. Kapitel 5
single