Support Bundle

The support bundle API puts SDK logs, frames, and camera information into one archive (.tar.zst) that you send to Zivid customer support. The API is experimental and can change without notice. It is available only in C++.

Create a builder with Experimental::SupportBundle::builder, select what to include, and call Experimental::SupportBundle::Builder::create. The SDK creates the bundle in the background. The function gives a Experimental::SupportBundle::Future immediately, which reports the progress and gives the path of the finished bundle. Creating a bundle does not connect to cameras, so connect each camera that you want health information for before you create the bundle. To see the time span of each log file, use Experimental::SupportBundle::logFiles.

To create a bundle with Zivid Studio, or for a step-by-step guide with a code sample, see Support Bundle.

Builder builder(const std::filesystem::path &destinationFolder)

Starts configuring a support bundle that will be written to the given folder.

The folder must already exist, otherwise this function throws. The bundle gets a unique, generated file name in the folder, and an existing file is never overwritten.

class Builder

Configures a support bundle: a compressed archive (.tar.zst) of SDK logs, frames and camera information to send to Zivid customer support.

Create one with builder, set what to include, then call create. Collection runs in the background and create returns a Future right away. Use Future::progress to follow the collection and Future::get to get the path of the finished bundle.

A bundle contains:

  • SDK log files whose time span overlaps the filter set with filterLogs, or all of them if none is set

  • the attached frames and ZDF files

  • information and state of every camera the application knows about, and health for cameras that are connected

Creating a bundle never connects to a camera. Connect the cameras you want health information for before creating it.

Public Functions

Builder &attachedFrames(std::vector<Frame> frames)

Frames to include in the bundle. They are saved as ZDF files. Replaces any frames set earlier.

Builder &attachedFrame2Ds(std::vector<Frame2D> frames)

2D frames to include in the bundle.

They are saved as ZDF files. Replaces any 2D frames set earlier.

Builder &attachedZDFFiles(std::vector<std::filesystem::path> files)

ZDF files to include in the bundle.

Replaces any files set earlier.

Each file is checked when it is set, and this function throws if one is not a valid ZDF file.

Builder &filterLogs(std::chrono::system_clock::time_point since, std::chrono::system_clock::time_point before)

Includes only the log files that were written to between since and before .

A log file is included when its time span overlaps the filter, so a file that started before the filter and is still being written to is included. Throws if since is after before .

SizeEstimate estimateSize() const

Estimates how large the bundle will be, split into logs and frames.

Logs and ZDF files are counted with their size on disk. Frames held in memory are estimated from their resolution and settings, and the estimate errs on the large side. The actual bundle can differ, since logs keep growing and the archive is compressed.

Future create(Application &application) const

Creates the support bundle from the given application in the background, and returns a Future for it right away.

The bundle is made from what is already there: the logs, frames and cameras at the time of the call. The application must outlive the returned Future. The Builder is not changed by creating a bundle, so it can create another one. Camera health is checked while the bundle is created: if a connected camera disconnects while its health is being checked, creating the bundle fails. Destroying the returned Future cancels creating the bundle, so the result must be kept.

class Future

A support bundle being collected in the background, returned by Builder::create.

Destroying the Future cancels the collection if it has not finished.

Public Functions

std::filesystem::path get() const

Blocks until collection has finished, then returns the path of the support bundle.

If collection failed, this function throws the error that stopped it. It can be called more than once, and returns the same path or throws the same error each time.

void wait() const

Blocks until collection has finished or failed.

std::future_status waitFor(std::chrono::nanoseconds timeout) const

Blocks until collection has finished or failed, or until the timeout has passed.

Returns std::future_status::ready or std::future_status::timeout.

Progress progress() const

Returns a view of the collection’s progress. It stays valid after the Future is destroyed.

class Progress

A view of a support bundle collection’s progress, from Future::progress.

It can be used in two ways, which can be mixed:

  • iterate over it in a range-based for loop. Each step blocks until a new update arrives, and the loop ends when collection has finished or failed. Use this from a worker thread.

  • call latest to poll the newest update without blocking, for example from a UI timer.

Iteration starts at the newest update and skips updates that arrive while the loop body runs. The last update is 100 percent when collection succeeds. Errors are not reported here; call Future::get to get them.

Public Functions

Update latest() const

Returns the newest update without blocking.

Detail::ProgressIterator begin() const

Returns an iterator at the newest update. Used by range-based for loops.

Public Static Functions

static Detail::ProgressSentinel end()

Returns the end of the range, reached when collection has finished or failed.

struct Update

A snapshot of how far collection has come.

Public Members

double percentage

Progress from 0 to 100. It never decreases.

std::string description

What is being collected, for example “Adding log files”.

struct SizeEstimate

An estimate of the size of a support bundle, in bytes, split by content.

Public Members

std::uint64_t logBytes

The size of the log files the bundle will include.

std::uint64_t frameBytes

The size of the attached frames and ZDF files.

struct LogFileInfo

The time span and size of one log file, returned from logFiles.

Public Members

std::chrono::system_clock::time_point created

When the first entry in the file was written.

std::chrono::system_clock::time_point modified

When the file was last written to.

std::uint64_t sizeBytes

The size of the file.