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

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

本文整理了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

@Override
  protected void out(final String message) {
    log.debug(message);
  }
}

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

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

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

/**
 * Logs a message at DEBUG level.
 */
default void debug(final Supplier<String> messageSupplier) {
  if (isDebugEnabled()) {
    debug(messageSupplier.get());
  }
}

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

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

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

@Override
  protected void scanClassPath(final File root) {
    log.debug("Scanning path: " + root);
    super.scanClassPath(root);
  }
};

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

/**
 * Saves Locale to HTTP session.
 */
public static void setSessionLocale(final HttpSession session, final String localeCode) {
  if (log.isDebugEnabled()) {
    log.debug("Locale stored to session: " + localeCode);
  }
  Locale locale = Locale.forLanguageTag(localeCode);
  session.setAttribute(SESSION_LOCALE_ATTR, locale);
}

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

/**
 * Sets bundle name for provided servlet request.
 */
public static void setRequestBundleName(final ServletRequest request, final String bundleName) {
  if (log.isDebugEnabled()) {
    log.debug("Bundle name for this request: " + bundleName);
  }
  request.setAttribute(REQUEST_BUNDLE_NAME_ATTR, bundleName);
}

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

/**
 * Commits transaction if created in the same level where this method is invoked.
 * Returns <code>true</code> if transaction was actually committed or <code>false</code>
 * if transaction was not created on this level. 
 */
public boolean maybeCommitTransaction(final JtxTransaction tx) {
  if (tx == null) {
    return false;
  }
  log.debug("commit tx");
  tx.commit();
  return true;
}

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

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

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

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

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

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

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

/**
 * Returns <code>true</code> if target exists.
 */
protected boolean targetExists(final ActionRequest actionRequest, final String target) {
  if (log.isDebugEnabled()) {
    log.debug("target check: " + target);
  }
  final ServletContext servletContext = actionRequest.getHttpServletRequest().getServletContext();
  try {
    return servletContext.getResource(target) != null;
  } catch (MalformedURLException ignore) {
    return false;
  }
}

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

/**
 * Creates new Petite container using {@link PetiteContainer provided configuration}.
 */
public PetiteContainer(final PetiteConfig config) {
  super(config);
  scopedProxyManager = new ScopedProxyManager();
  if (log.isDebugEnabled()) {
    log.debug("Petite container created");
  }
}

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

/**
 * Starts a transaction.
 */
public void beginTransaction(final DbTransactionMode mode) {
  log.debug("Beginning transaction");
  assertTxIsClosed();
  this.txMode = mode;
  openTx();
}

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

/**
 * {@inheritDoc}
 */
@Override
public DbSession getDbSession() {
  log.debug("Requesting thread session");
  final DbSession session = ThreadDbSessionHolder.get();
  if (session == null) {
    throw new DbSqlException(
        "No DbSession associated with current thread." +
        "It seems that ThreadDbSessionHolder is not used.");
  }
  return session;
}

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

/**
 * {@inheritDoc}
 */
public DbSession beginTransaction(final JtxTransactionMode jtxMode, final boolean active) {
  DbSession session = new DbSession(connectionProvider);
  if (active) {
    log.debug("begin jtx");
    session.beginTransaction(JtxDbUtil.convertToDbMode(jtxMode));
  }
  return session;
}

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

/**
 * Logout hook.
 */
protected JsonResult logout() {
  log.debug("logout user");
  UserSession.stop(servletRequest, servletResponse);
  return JsonResult.of(HttpStatus.ok());
}

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

/**
 * {@inheritDoc}
 */
public void commitTransaction(final DbSession resource) {
  if (resource.isTransactionActive()) {
    log.debug("commit jtx");
    resource.commitTransaction();
  }
  resource.closeSession();
}

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

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

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

@Test
void testNopLogger() {
  LoggerFactory.setLoggerProvider(NOPLogger.PROVIDER);
  Logger log = LoggerFactory.getLogger("foo");
  assertEquals("*", log.getName());
  PrintStream out = System.out;
  ByteArrayOutputStream sos = new ByteArrayOutputStream();
  System.setOut(new PrintStream(sos));
  log.debug("nothing");
  log.error("nothing");
  assertEquals("", sos.toString());
  System.setOut(out);
}

相关文章