improve logging for Moodle user Details

This commit is contained in:
anhefti 2024-07-18 12:00:22 +02:00
parent 93858944d8
commit 6c4902db02
3 changed files with 31 additions and 0 deletions

View file

@ -530,6 +530,29 @@ public abstract class MoodleUtils {
this.mailformat = mailformat;
this.descriptionformat = descriptionformat;
}
@Override
public String toString() {
return "MoodleUserDetails{" +
"id='" + id + '\'' +
", username='" + username + '\'' +
", firstname='" + firstname + '\'' +
", lastname='" + lastname + '\'' +
", fullname='" + fullname + '\'' +
", email='" + email + '\'' +
", department='" + department + '\'' +
", firstaccess=" + firstaccess +
", lastaccess=" + lastaccess +
", auth='" + auth + '\'' +
", suspended=" + suspended +
", confirmed=" + confirmed +
", lang='" + lang + '\'' +
", theme='" + theme + '\'' +
", timezone='" + timezone + '\'' +
", description='" + description + '\'' +
", mailformat=" + mailformat +
", descriptionformat=" + descriptionformat +
'}';
}
}
@JsonIgnoreProperties(ignoreUnknown = true)

View file

@ -403,6 +403,10 @@ public class MoodleCourseAccess implements CourseAccessAPI {
throw new RuntimeException("No user details on Moodle API request");
}
if (log.isDebugEnabled()) {
log.debug("User details received from Moodle: {}", userDetails[0]);
}
final Map<String, String> additionalAttributes = MoodleUtils.getMoodleAccountDetails(userDetails);
return new ExamineeAccountDetails(
userDetails[0].id,

View file

@ -339,6 +339,10 @@ public class MoodlePluginCourseAccess extends AbstractCachedCourseAccess impleme
throw new RuntimeException("No user details on Moodle API request");
}
if (log.isDebugEnabled()) {
log.debug("User details received from Moodle: {}", userDetails[0]);
}
final Map<String, String> additionalAttributes = MoodleUtils.getMoodleAccountDetails(userDetails);
return new ExamineeAccountDetails(
userDetails[0].id,