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

devonfw / IDEasy / 11963246771

21 Nov 2024 11:10PM UTC coverage: 67.428% (+0.2%) from 67.239%
11963246771

push

github

web-flow
#754: bullet proof solution for processable output and logging (#777)

2487 of 4028 branches covered (61.74%)

Branch coverage included in aggregate %.

6454 of 9232 relevant lines covered (69.91%)

3.09 hits per line

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

91.67
cli/src/main/java/com/devonfw/tools/ide/log/IdeLogLevel.java
1
package com.devonfw.tools.ide.log;
2

3
import com.devonfw.tools.ide.context.IdeContext;
4

5
/**
6
 * {@link Enum} with the available log-levels.
7
 *
8
 * @see IdeContext#level(IdeLogLevel)
9
 */
10
public enum IdeLogLevel {
3✔
11

12
  /** {@link IdeLogLevel} for tracing (very detailed and verbose logging). */
13
  TRACE("\033[38;5;240m"),
7✔
14

15
  /** {@link IdeLogLevel} for debugging (more detailed logging). */
16
  DEBUG("\033[90m"),
7✔
17

18
  /** {@link IdeLogLevel} for general information (regular logging). */
19
  INFO(null),
7✔
20

21
  /**
22
   * {@link IdeLogLevel} for a step (logs the step name and groups the following log statements until the next step).
23
   */
24
  STEP("\033[35m"),
7✔
25

26
  /** {@link IdeLogLevel} for user interaction (e.g. questions or options). */
27
  INTERACTION("\033[96m"),
7✔
28

29
  /** {@link IdeLogLevel} for success (an important aspect has been completed successfully). */
30
  SUCCESS("\033[92m"),
7✔
31

32
  /** {@link IdeLogLevel} for a warning (something unexpected or abnormal happened but can be compensated). */
33
  WARNING("\033[93m"),
7✔
34

35
  /**
36
   * {@link IdeLogLevel} for an error (something failed and we cannot proceed or the user has to continue with extreme care).
37
   */
38
  ERROR("\033[91m"),
7✔
39

40
  /** {@link IdeLogLevel} for {@link com.devonfw.tools.ide.commandlet.Commandlet#isProcessableOutput() processable output} */
41
  PROCESSABLE(null);
7✔
42

43
  private final String color;
44

45
  /**
46
   * The constructor.
47
   */
48
  private IdeLogLevel(String color) {
4✔
49

50
    this.color = color;
3✔
51
  }
1✔
52

53
  /**
54
   * @return the prefix to append for colored output to set color according to this {@link IdeLogLevel}.
55
   */
56
  public String getStartColor() {
57

58
    return this.color;
×
59
  }
60

61
  /**
62
   * @return the suffix to append for colored output to reset to default color.
63
   */
64
  public String getEndColor() {
65

66
    return "\033[0m"; // reset color
×
67
  }
68

69
  /**
70
   * @return {@code true} in case of a custom log-level, {@code false} otherwise (standard log-level supported by SLF4J and all reasonable loggers).
71
   */
72
  public boolean isCustom() {
73

74
    return (this == STEP) || (this == INTERACTION) || (this == SUCCESS) || (this == PROCESSABLE);
16✔
75
  }
76

77
}
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