sapling/eden/fs/store/BackingStoreLogger.h
Chad Austin 49385c8a07 store: namespace facebook::eden
Summary: C++17

Reviewed By: fanzeyi

Differential Revision: D28966939

fbshipit-source-id: c8c9d49bc02557263a6acf9357c90b50e04fbdb9
2021-06-08 19:29:37 -07:00

45 lines
1.1 KiB
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include <folly/Executor.h>
#include <string>
#include "eden/fs/store/ObjectFetchContext.h"
#include "eden/fs/utils/PathFuncs.h"
namespace facebook::eden {
class UnboundedQueueExecutor;
class StructuredLogger;
class ProcessNameCache;
class BackingStoreLogger {
public:
BackingStoreLogger(
std::shared_ptr<StructuredLogger> logger,
std::shared_ptr<ProcessNameCache> processNameCache);
// for unit tests so that a no-op logger can be passed into the backing store
BackingStoreLogger() = default;
void logImport(
ObjectFetchContext& context,
RelativePathPiece importPath,
ObjectFetchContext::ObjectType fetchedType);
private:
std::shared_ptr<StructuredLogger> logger_;
std::shared_ptr<ProcessNameCache> processNameCache_;
// for unit tests so that a no-op logger can be passed into the backing store
bool loggingAvailable_ = false;
};
} // namespace facebook::eden