mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
49385c8a07
Summary: C++17 Reviewed By: fanzeyi Differential Revision: D28966939 fbshipit-source-id: c8c9d49bc02557263a6acf9357c90b50e04fbdb9
45 lines
1.1 KiB
C++
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
|