jodd.log.Logger.debug()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(310)

本文整理了Java中jodd.log.Logger.debug()方法的一些代码示例,展示了Logger.debug()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.debug()方法的具体详情如下:
包路径:jodd.log.Logger
类名称:Logger
方法名:debug

Logger.debug介绍

[英]Logs a message at DEBUG level.
[中]在调试级别记录消息。

代码示例

代码示例来源:origin: oblac/jodd

  1. @Override
  2. protected void out(final String message) {
  3. log.debug(message);
  4. }
  5. }

代码示例来源:origin: oblac/jodd

  1. public ScopedProxyManager() {
  2. log.debug("ScopedProxyManager created");
  3. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Logs a message at DEBUG level.
  3. */
  4. default void debug(final Supplier<String> messageSupplier) {
  5. if (isDebugEnabled()) {
  6. debug(messageSupplier.get());
  7. }
  8. }

代码示例来源:origin: oblac/jodd

  1. @Override
  2. protected void scanJarFile(final File file) {
  3. log.debug("Scanning jar: " + file);
  4. super.scanJarFile(file);
  5. }

代码示例来源:origin: oblac/jodd

  1. @Override
  2. protected void scanClassPath(final File root) {
  3. log.debug("Scanning path: " + root);
  4. super.scanClassPath(root);
  5. }
  6. };

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Saves Locale to HTTP session.
  3. */
  4. public static void setSessionLocale(final HttpSession session, final String localeCode) {
  5. if (log.isDebugEnabled()) {
  6. log.debug("Locale stored to session: " + localeCode);
  7. }
  8. Locale locale = Locale.forLanguageTag(localeCode);
  9. session.setAttribute(SESSION_LOCALE_ATTR, locale);
  10. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Sets bundle name for provided servlet request.
  3. */
  4. public static void setRequestBundleName(final ServletRequest request, final String bundleName) {
  5. if (log.isDebugEnabled()) {
  6. log.debug("Bundle name for this request: " + bundleName);
  7. }
  8. request.setAttribute(REQUEST_BUNDLE_NAME_ATTR, bundleName);
  9. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Commits transaction if created in the same level where this method is invoked.
  3. * Returns <code>true</code> if transaction was actually committed or <code>false</code>
  4. * if transaction was not created on this level.
  5. */
  6. public boolean maybeCommitTransaction(final JtxTransaction tx) {
  7. if (tx == null) {
  8. return false;
  9. }
  10. log.debug("commit tx");
  11. tx.commit();
  12. return true;
  13. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Registers component instance and wires it with internal container.
  3. * Warning: in this moment we can not guarantee that all other components
  4. * are registered, replaced or configuration is update; therefore DO NOT
  5. * USE injection, unless you are absolutely sure it works.
  6. */
  7. public void registerComponentInstance(final String name, final Object componentInstance) {
  8. log.debug(() -> "Madvoc WebApp component: [" + name + "] --> " + componentInstance.getClass().getName());
  9. madpc.removeBean(name);
  10. madpc.addBean(name, componentInstance);
  11. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Registers Madvoc component with given name.
  3. */
  4. public <T> void registerComponent(final String name, final Class<T> component, final Consumer<T> consumer) {
  5. log.debug(() -> "Madvoc WebApp component: [" + name + "] --> " + component.getName());
  6. madpc.removeBean(name);
  7. madpc.registerPetiteBean(component, name, null, null, false, consumer);
  8. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Registers Madvoc component with given name.
  3. */
  4. public void registerComponent(final String name, final Class component) {
  5. log.debug(() -> "Madvoc WebApp component: [" + name + "] --> " + component.getName());
  6. madpc.removeBean(name);
  7. madpc.registerPetiteBean(component, name, null, null, false, null);
  8. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Returns <code>true</code> if target exists.
  3. */
  4. protected boolean targetExists(final ActionRequest actionRequest, final String target) {
  5. if (log.isDebugEnabled()) {
  6. log.debug("target check: " + target);
  7. }
  8. final ServletContext servletContext = actionRequest.getHttpServletRequest().getServletContext();
  9. try {
  10. return servletContext.getResource(target) != null;
  11. } catch (MalformedURLException ignore) {
  12. return false;
  13. }
  14. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Creates new Petite container using {@link PetiteContainer provided configuration}.
  3. */
  4. public PetiteContainer(final PetiteConfig config) {
  5. super(config);
  6. scopedProxyManager = new ScopedProxyManager();
  7. if (log.isDebugEnabled()) {
  8. log.debug("Petite container created");
  9. }
  10. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Starts a transaction.
  3. */
  4. public void beginTransaction(final DbTransactionMode mode) {
  5. log.debug("Beginning transaction");
  6. assertTxIsClosed();
  7. this.txMode = mode;
  8. openTx();
  9. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public DbSession getDbSession() {
  6. log.debug("Requesting thread session");
  7. final DbSession session = ThreadDbSessionHolder.get();
  8. if (session == null) {
  9. throw new DbSqlException(
  10. "No DbSession associated with current thread." +
  11. "It seems that ThreadDbSessionHolder is not used.");
  12. }
  13. return session;
  14. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public DbSession beginTransaction(final JtxTransactionMode jtxMode, final boolean active) {
  5. DbSession session = new DbSession(connectionProvider);
  6. if (active) {
  7. log.debug("begin jtx");
  8. session.beginTransaction(JtxDbUtil.convertToDbMode(jtxMode));
  9. }
  10. return session;
  11. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Logout hook.
  3. */
  4. protected JsonResult logout() {
  5. log.debug("logout user");
  6. UserSession.stop(servletRequest, servletResponse);
  7. return JsonResult.of(HttpStatus.ok());
  8. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void commitTransaction(final DbSession resource) {
  5. if (resource.isTransactionActive()) {
  6. log.debug("commit jtx");
  7. resource.commitTransaction();
  8. }
  9. resource.closeSession();
  10. }

代码示例来源:origin: oblac/jodd

  1. /**
  2. * Returns session from JTX transaction manager and started transaction.
  3. */
  4. @Override
  5. public DbSession getDbSession() {
  6. log.debug("Requesting db TX manager session");
  7. final DbJtxTransaction jtx = (DbJtxTransaction) jtxTxManager.getTransaction();
  8. if (jtx == null) {
  9. throw new DbSqlException(
  10. "No transaction is in progress and DbSession can't be provided. " +
  11. "It seems that transaction manager is not used to begin a transaction.");
  12. }
  13. return jtx.requestResource();
  14. }

代码示例来源:origin: oblac/jodd

  1. @Test
  2. void testNopLogger() {
  3. LoggerFactory.setLoggerProvider(NOPLogger.PROVIDER);
  4. Logger log = LoggerFactory.getLogger("foo");
  5. assertEquals("*", log.getName());
  6. PrintStream out = System.out;
  7. ByteArrayOutputStream sos = new ByteArrayOutputStream();
  8. System.setOut(new PrintStream(sos));
  9. log.debug("nothing");
  10. log.error("nothing");
  11. assertEquals("", sos.toString());
  12. System.setOut(out);
  13. }

相关文章