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

mybatis / spring / 1949

09 Jul 2026 10:07PM UTC coverage: 90.381% (+0.1%) from 90.242%
1949

push

github

web-flow
Merge pull request #1269 from mybatis/renovate/byte-buddy.version

Update byte-buddy.version to v1.18.11-jdk5

323 of 386 branches covered (83.68%)

949 of 1050 relevant lines covered (90.38%)

0.9 hits per line

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

46.67
/src/main/java/org/mybatis/logging/Logger.java
1
/*
2
 * Copyright 2010-2026 the original author or authors.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *    https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package org.mybatis.logging;
17

18
import java.util.function.Supplier;
19

20
import org.apache.commons.logging.Log;
21

22
/**
23
 * Wrapper of {@link Log}, allow log with lambda expressions.
24
 *
25
 * @author Putthiphong Boonphong
26
 */
27
public class Logger {
28

29
  /** The log. */
30
  private final Log log;
31

32
  /**
33
   * Instantiates a new logger.
34
   *
35
   * @param log
36
   *          the log
37
   */
38
  Logger(Log log) {
1✔
39
    this.log = log;
1✔
40
  }
1✔
41

42
  /**
43
   * Error.
44
   *
45
   * @param s
46
   *          the s
47
   * @param e
48
   *          the e
49
   */
50
  public void error(Supplier<String> s, Throwable e) {
51
    log.error(s.get(), e);
×
52
  }
×
53

54
  /**
55
   * Error.
56
   *
57
   * @param s
58
   *          the s
59
   */
60
  public void error(Supplier<String> s) {
61
    log.error(s.get());
×
62
  }
×
63

64
  /**
65
   * Warn.
66
   *
67
   * @param s
68
   *          the s
69
   */
70
  public void warn(Supplier<String> s) {
71
    log.warn(s.get());
1✔
72
  }
1✔
73

74
  /**
75
   * Debug.
76
   *
77
   * @param s
78
   *          the s
79
   */
80
  public void debug(Supplier<String> s) {
81
    if (log.isDebugEnabled()) {
1!
82
      log.debug(s.get());
×
83
    }
84
  }
1✔
85

86
  /**
87
   * Trace.
88
   *
89
   * @param s
90
   *          the s
91
   */
92
  public void trace(Supplier<String> s) {
93
    if (log.isTraceEnabled()) {
×
94
      log.trace(s.get());
×
95
    }
96
  }
×
97

98
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc