• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DataBiosphere / consent / #5048

25 Apr 2024 05:04PM UTC coverage: 76.044% (+0.008%) from 76.036%
#5048

push

web-flow
[DUOS-3007][risk=no] Log stack trace when retrieving Sam user info fails (#2311)

0 of 3 new or added lines in 2 files covered. (0.0%)

9558 of 12569 relevant lines covered (76.04%)

0.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.22
/src/main/java/org/broadinstitute/consent/http/util/ConsentLogger.java
1
package org.broadinstitute.consent.http.util;
2

3
import io.sentry.Sentry;
4
import io.sentry.SentryEvent;
5
import org.slf4j.Logger;
6
import org.slf4j.LoggerFactory;
7

8
public interface ConsentLogger {
9

10
  @SuppressWarnings("rawtypes")
11
  default Logger getLogger(Class clazz) {
12
    return LoggerFactory.getLogger(clazz);
1✔
13
  }
14

15
  /**
16
   * Logs an exception to the console and to Sentry
17
   *
18
   * @param e Exception
19
   */
20
  default void logException(Exception e) {
21
    getLogger(this.getClass()).error(e.getMessage());
1✔
22
    Sentry.captureEvent(new SentryEvent(e));
1✔
23
  }
1✔
24

25
  /**
26
   * Logs a throwable to the console and to Sentry
27
   *
28
   * @param t Throwable
29
   */
30
  default void logThrowable(Throwable t) {
31
    getLogger(this.getClass()).error(t.getMessage());
×
32
    Sentry.captureEvent(new SentryEvent(t));
×
33
  }
×
34

35
  /**
36
   * Logs a message and exception to the console and to Sentry
37
   *
38
   * @param message The message
39
   * @param e       Exception
40
   */
41
  default void logException(String message, Exception e) {
42
    getLogger(this.getClass()).error(message + e.getMessage());
1✔
43
    Sentry.captureEvent(new SentryEvent(e));
1✔
44
  }
1✔
45

46
  /**
47
   * Logs a warning message to the console
48
   *
49
   * @param message Error Message
50
   */
51
  default void logWarn(String message) {
52
    getLogger(this.getClass()).warn(message);
1✔
53
  }
1✔
54

55
  /**
56
   * Logs a warning message and throwable to the console
57
   *
58
   * @param message Error Message
59
   * @param t       Exception
60
   */
61
  default void logWarn(String message, Throwable t) {
NEW
62
    getLogger(this.getClass()).warn(message, t);
×
NEW
63
  }
×
64

65
  /**
66
   * Logs an info message to the console
67
   *
68
   * @param message Error Message
69
   */
70
  default void logInfo(String message) {
71
    getLogger(this.getClass()).info(message);
1✔
72
  }
1✔
73

74
  /**
75
   * Logs a debug message to the console
76
   *
77
   * @param message Error Message
78
   */
79
  default void logDebug(String message) {
80
    getLogger(this.getClass()).debug(message);
1✔
81
  }
1✔
82
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc