blob: f6d525e6167fe2534a987ee1f5d052cc57804972 (
plain) (
blame)
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
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/util/jsonwriter.h>
namespace search::util {
class LogUtil {
public:
/**
* Extract the last num elements from the given path and
* return a new path with these elements.
**/
static vespalib::string extractLastElements(const vespalib::string & path, size_t numElems);
/**
* Log the given directory (with size) to the given json stringer.
*
* @param jstr the json stringer to log into.
* @param path the path of the directory to log.
* @param numElems the last number of elements from the path to log.
**/
static void logDir(vespalib::JSONStringer & jstr, const vespalib::string & path, size_t numElems);
};
}
|