Fixed logging messages to be under a guard

git-svn-id: https://hyracks.googlecode.com/svn/branches/hyracks_storage_cleanup@260 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/buffercache/BufferCache.java b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/buffercache/BufferCache.java
index b6c8709..7578f39 100644
--- a/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/buffercache/BufferCache.java
+++ b/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/buffercache/BufferCache.java
@@ -26,6 +26,7 @@
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
@@ -492,7 +493,9 @@
 
     @Override
     public void createFile(String fileName) throws HyracksDataException {
-        LOGGER.info("Deleting file: " + fileName + " in cache: " + this);
+        if (LOGGER.isLoggable(Level.INFO)) {
+            LOGGER.info("Creating file: " + fileName + " in cache: " + this);
+        }
         synchronized (fileInfoMap) {
             fileMapManager.registerFile(fileName);
         }
@@ -500,7 +503,9 @@
 
     @Override
     public void openFile(int fileId) throws HyracksDataException {
-        LOGGER.info("Opening file: " + fileId + " in cache: " + this);
+        if (LOGGER.isLoggable(Level.INFO)) {
+            LOGGER.info("Opening file: " + fileId + " in cache: " + this);
+        }
         synchronized (fileInfoMap) {
             FileHandle fInfo;
             fInfo = fileInfoMap.get(fileId);
@@ -572,7 +577,9 @@
 
     @Override
     public void closeFile(int fileId) throws HyracksDataException {
-        LOGGER.info("Closing file: " + fileId + " in cache: " + this);
+        if (LOGGER.isLoggable(Level.INFO)) {
+            LOGGER.info("Closing file: " + fileId + " in cache: " + this);
+        }
         synchronized (fileInfoMap) {
             FileHandle fInfo = fileInfoMap.get(fileId);
             if (fInfo == null) {
@@ -588,7 +595,9 @@
 
     @Override
     public synchronized void deleteFile(int fileId) throws HyracksDataException {
-        LOGGER.info("Deleting file: " + fileId + " in cache: " + this);
+        if (LOGGER.isLoggable(Level.INFO)) {
+            LOGGER.info("Deleting file: " + fileId + " in cache: " + this);
+        }
         synchronized (fileInfoMap) {
             FileHandle fInfo = fileInfoMap.get(fileId);
             if (fInfo != null) {