Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#pragma once
 
#include "core/common/logging/logging.h"
#include "core/common/logging/isink.h"
 
namespace onnxruntime {
namespace test {
 
using namespace ::onnxruntime::logging;
 
class CapturingSink : public logging::ISink {
 public:
  void SendImpl(const Timestamp& timestamp, const std::string& logger_id, const Capture& message) override {
    std::ostringstream msg;
 
    msg << timestamp << " [" << message.SeverityPrefix() << ":" << message.Category() << ":" << logger_id << ", "
        << message.Location().ToString() << "] " << message.Message();
 
    messages_.push_back(msg.str());
  }
 
  const std::vector<std::string>& Messages() const {
    return messages_;
  }
 
 private:
  std::vector<std::string> messages_;
};
}  // namespace test
}  // namespace onnxruntime