| // Copyright 2022 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef THIRD_PARTY_ZLIB_GOOGLE_REDACT_H_ |
| #define THIRD_PARTY_ZLIB_GOOGLE_REDACT_H_ |
| #include "base/files/file_path.h" |
| #include "base/logging.h" |
| // Redacts file paths in log messages. |
| // LOG(ERROR) << "Cannot open " << Redact(path); |
| explicit Redact(const base::FilePath& path) : path_(path) {} |
| friend std::ostream& operator<<(std::ostream& out, const Redact&& r) { |
| return LOG_IS_ON(INFO) ? out << "'" << r.path_ << "'" : out << "(redacted)"; |
| const base::FilePath& path_; |
| #endif // THIRD_PARTY_ZLIB_GOOGLE_REDACT_H_ |