File: custom_log_record_processor.cc

package info (click to toggle)
opentelemetry-cpp 1.23.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,368 kB
  • sloc: cpp: 96,239; sh: 1,766; makefile: 38; python: 31
file content (36 lines) | stat: -rw-r--r-- 1,145 bytes parent folder | download
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
34
35
36
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <utility>

#include "opentelemetry/sdk/common/global_log_handler.h"
#include "opentelemetry/sdk/logs/read_write_log_record.h"
#include "opentelemetry/sdk/logs/recordable.h"

#include "custom_log_record_processor.h"

std::unique_ptr<opentelemetry::sdk::logs::Recordable>
CustomLogRecordProcessor::MakeRecordable() noexcept
{
  auto recordable = std::make_unique<opentelemetry::sdk::logs::ReadWriteLogRecord>();
  return recordable;
}

void CustomLogRecordProcessor::OnEmit(
    std::unique_ptr<opentelemetry::sdk::logs::Recordable> &&span) noexcept
{
  OTEL_INTERNAL_LOG_ERROR("CustomLogRecordProcessor::OnEnd(): YOUR CODE HERE");
  auto unused = std::move(span);
}

bool CustomLogRecordProcessor::ForceFlush(std::chrono::microseconds /* timeout */) noexcept
{
  OTEL_INTERNAL_LOG_ERROR("CustomLogRecordProcessor::ForceFlush(): YOUR CODE HERE");
  return false;
}

bool CustomLogRecordProcessor::Shutdown(std::chrono::microseconds /* timeout */) noexcept
{
  OTEL_INTERNAL_LOG_ERROR("CustomLogRecordProcessor::Shutdown(): YOUR CODE HERE");
  return false;
}