Challenge: Secure Logging
Tarea
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.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 2. Capítulo 5
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Suggested prompts:
Can you explain that in simpler terms?
What are the main benefits of this approach?
Are there any common mistakes to avoid with this?
Awesome!
Completion rate improved to 5.56
Challenge: Secure Logging
Desliza para mostrar el menú
Tarea
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.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 2. Capítulo 5
single