I'm working on a Java application which handles multiple sensitive values. We are using Lombok, and have a lot of data classes which look like this the below. However, it's confusing to see these classes in the log with no indication that they contain some critical fields, as the generated toString will 100% ignore the excluded fields. Is it possible to have Lombok print something like clientSecret=<HIDDEN> without writing a custom toString for each class?
/** data we will send to token endpoint */
@Data
public class TokenReq {
private String grantType;
private String code;
private String clientId;
@ToString.Exclude
private String refreshToken;
@ToString.Exclude
private String clientSecret;
private String redirectUri;
}