Fastly Compute C++ SDK
Loading...
Searching...
No Matches

#include <log.h>

Public Member Functions

std::string name ()
 Get the name of an Endpoint.

Static Public Member Functions

static fastly::expected< Endpointfrom_name (std::string_view name)

Friends

void init_simple (Endpoint endpoint, LogLevelFilter level)

Detailed Description

A Fastly logging endpoint.

To write to this endpoint, use the <iostream> interface:

auto endpoint{fastly::log::Endpoint::from_name("my_log_endpoint")};
endpoint << "stuff happened y'all";
static fastly::expected< Endpoint > from_name(std::string_view name)

Member Function Documentation

◆ from_name()

fastly::expected< Endpoint > fastly::log::Endpoint::from_name ( std::string_view name)
static

Try to get an Endpoint by name.

Currently, the conditions on an endpoint name are:

  • It must not be empty
  • It must not contain newlines (\n) or colons (:)
  • It must not be stdout or stderr, which are reserved for debugging.

◆ name()

std::string fastly::log::Endpoint::name ( )

Get the name of an Endpoint.

◆ init_simple

void init_simple ( Endpoint endpoint,
LogLevelFilter level )
friend

Initialize logging with a single endpoint filtered by log level.

For advanced configuration, see the LoggerBuilder class, and the module-level documentation.

fastly::log::init_simple("my_endpoint", fastly::log::LogLevelFilter::Warn);
fastly::log::warn("This will be written to my_endpoint...");
fastly::log::info("...but this won't");
void init_simple(Endpoint endpoint, LogLevelFilter level)
void warn(std::format_string< Args... > fmt, Args &&...args)
Definition log.h:252
void info(std::format_string< Args... > fmt, Args &&...args)
Definition log.h:294

The documentation for this class was generated from the following file: