Skip to content

Commit

Permalink
Use context only for logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja committed Jan 2, 2014
1 parent 7f64d4c commit a59e0a4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/XrdFileCache.cmake
Expand Up @@ -18,7 +18,7 @@ add_library(
XrdFileCache/CacheFileInfo.cc XrdFileCache/CacheFileInfo.hh
XrdFileCache/IO.cc XrdFileCache/IO.hh
XrdFileCache/IOBlocks.cc XrdFileCache/IOBlocks.hh
XrdFileCache/Context.cc XrdFileCache/Context.hh )
XrdFileCache/Log.cc XrdFileCache/Log.hh )

target_link_libraries(
XrdFileCache
Expand Down
6 changes: 6 additions & 0 deletions src/XrdFileCache/Cache.cc
Expand Up @@ -20,6 +20,12 @@ XrdFileCache::Cache *XrdFileCache::Cache::m_cache = NULL;
XrdSysMutex XrdFileCache::Cache::m_cache_mutex;


const char* InfoExt = ".cinfo";
const int InfoExtLen = int(strlen(InfoExt));
const bool IODisablePrefetch = false;
const long long PrefetchDefaultBufferSize = 1024*1024;


using namespace XrdFileCache;

Cache::Cache(XrdOucCacheStats & stats)
Expand Down
5 changes: 5 additions & 0 deletions src/XrdFileCache/Cache.hh
Expand Up @@ -15,6 +15,11 @@
namespace XrdFileCache
{

extern const char* InfoExt;
extern const int InfoExtLen;
extern const bool IODisablePrefetch;
extern const long long PrefetchDefaultBufferSize;

class Cache : public XrdOucCache
{

Expand Down
6 changes: 1 addition & 5 deletions src/XrdFileCache/Context.cc → src/XrdFileCache/Log.cc
@@ -1,4 +1,4 @@
#include "Context.hh"
#include "Log.hh"
#include <stdarg.h>
#include "XrdSys/XrdSysError.hh"
#include "XrdOuc/XrdOucCache.hh"
Expand All @@ -16,10 +16,6 @@
namespace XrdFileCache
{
LogLevel Dbg;
const char* InfoExt = ".cinfo";
const int InfoExtLen = int(strlen(InfoExt));
const bool IODisablePrefetch = false;
const long long PrefetchDefaultBufferSize = 1024*1024;

const char* const s_levelNames[] = { "Dump ", "Debug","Info ", "Warn ", "Err " };

Expand Down
6 changes: 0 additions & 6 deletions src/XrdFileCache/Context.hh → src/XrdFileCache/Log.hh
Expand Up @@ -13,8 +13,6 @@ class XrdOucCacheIO;
#define aMsgIO(level, io, format, ...) \
if (level >= Dbg) XrdFileCache::strprintfIO(level, io, format, ##__VA_ARGS__)



namespace XrdFileCache
{
enum LogLevel {
Expand All @@ -26,10 +24,6 @@ enum LogLevel {
};

extern LogLevel Dbg;
extern const char* InfoExt;
extern const int InfoExtLen;
extern const bool IODisablePrefetch;
extern const long long PrefetchDefaultBufferSize;

const char* levelName(LogLevel);
void strprintf(LogLevel level, const char* fmt, ...);
Expand Down

0 comments on commit a59e0a4

Please sign in to comment.