Package org.openapitools.codegen.utils
Class OnceLogger
- java.lang.Object
-
- org.slf4j.ext.LoggerWrapper
-
- org.openapitools.codegen.utils.OnceLogger
-
- All Implemented Interfaces:
org.slf4j.Logger
public class OnceLogger extends org.slf4j.ext.LoggerWrapper
Provides calling code a way to log important messages only once, regardless of how many times the invocation has occurred. This can be used, for instance, to log a warning like "One or more schemas aren't declared" without logging that message for every time the schema is mentioned in a document. This implementation currently only supports single-argument string literal log methods (e.g.Logger.debug(String)
).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
debug(String msg)
Delegate to the appropriate method of the underlying logger.void
error(String msg)
Delegate to the appropriate method of the underlying logger.void
info(String msg)
Delegate to the appropriate method of the underlying logger.static org.slf4j.Logger
once(org.slf4j.Logger logger)
void
trace(String msg)
Delegate to the appropriate method of the underlying logger.void
warn(String msg)
Delegate to the appropriate method of the underlying logger.-
Methods inherited from class org.slf4j.ext.LoggerWrapper
debug, debug, debug, debug, debug, debug, debug, debug, debug, error, error, error, error, error, error, error, error, error, getName, info, info, info, info, info, info, info, info, info, isDebugEnabled, isDebugEnabled, isErrorEnabled, isErrorEnabled, isInfoEnabled, isInfoEnabled, isTraceEnabled, isTraceEnabled, isWarnEnabled, isWarnEnabled, trace, trace, trace, trace, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn, warn, warn, warn, warn
-
-
-
-
Method Detail
-
once
public static org.slf4j.Logger once(org.slf4j.Logger logger)
-
trace
public void trace(String msg)
Delegate to the appropriate method of the underlying logger.- Specified by:
trace
in interfaceorg.slf4j.Logger
- Overrides:
trace
in classorg.slf4j.ext.LoggerWrapper
- Parameters:
msg
- The log message.
-
debug
public void debug(String msg)
Delegate to the appropriate method of the underlying logger.- Specified by:
debug
in interfaceorg.slf4j.Logger
- Overrides:
debug
in classorg.slf4j.ext.LoggerWrapper
- Parameters:
msg
- The log message.
-
info
public void info(String msg)
Delegate to the appropriate method of the underlying logger.- Specified by:
info
in interfaceorg.slf4j.Logger
- Overrides:
info
in classorg.slf4j.ext.LoggerWrapper
- Parameters:
msg
- The log message.
-
warn
public void warn(String msg)
Delegate to the appropriate method of the underlying logger.- Specified by:
warn
in interfaceorg.slf4j.Logger
- Overrides:
warn
in classorg.slf4j.ext.LoggerWrapper
- Parameters:
msg
- The log message.
-
error
public void error(String msg)
Delegate to the appropriate method of the underlying logger. Use this method sparingly. If you're limiting error messages, ask yourself whether your log fits better as a warning.- Specified by:
error
in interfaceorg.slf4j.Logger
- Overrides:
error
in classorg.slf4j.ext.LoggerWrapper
- Parameters:
msg
- The log message.
-
-