mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Lazily evaluated debug statement
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.openapi.diagnostic;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class LogUtil {
|
||||
@@ -23,4 +24,13 @@ public class LogUtil {
|
||||
public static String objectAndClass(@Nullable final Object o) {
|
||||
return o != null ? o + " (" + o.getClass().getName() + ")" : "null";
|
||||
}
|
||||
|
||||
/**
|
||||
* Format string syntax as in {@linkplain String#format(String, Object...)}.
|
||||
*/
|
||||
public static void debug(@NotNull Logger logger, @NotNull String format, Object... args) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(String.format(format, args));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user