Skip to content
LeviMC
Home
Projects
Docs
6
LeviLamina
Mod loader for Minecraft Bedrock Edition
LegacyScriptEngine
Runs LLSE script plugins on LeviLamina
lip
General package installer
LeviLauncher
Bedrock launcher for Windows and Android
Be.D.D.
Scripted client input for mod tests
bedboo
Bedrock bots with a mineflayer-compatible API
All repositories on GitHub
Mods
Blog
Community
About
English
English
简体中文
繁體中文
Auto
Light
Dark
Auto
Light
Dark
LeviLamina
User Guides
Developer Guides
API Guides
API Reference
Maintainer Guides
Resources
LeviLamina on GitHub
LeviMC
Home
Projects
Docs
6
LeviLamina
Mod loader for Minecraft Bedrock Edition
LegacyScriptEngine
Runs LLSE script plugins on LeviLamina
lip
General package installer
LeviLauncher
Bedrock launcher for Windows and Android
Be.D.D.
Scripted client input for mod tests
bedboo
Bedrock bots with a mineflayer-compatible API
All repositories on GitHub
Mods
Blog
Community
About
API Reference
On this page
LeviLamina
User Guides
Developer Guides
API Guides
API Reference
Maintainer Guides
Search
Ctrl
K
Loading...
Searching...
No Matches
RotatePolicy.h
1
#pragma once
2
3
#include <chrono>
4
#include <filesystem>
5
#include <functional>
6
#include <string>
7
8
#include "ll/api/base/Macro.h"
9
#include "ll/api/base/StdInt.h"
10
#include "ll/api/data/TmWithMs.h"
11
12
namespace
ll::io {
13
14
enum class
RotateInterval :
int
{
15
None,
16
Hourly,
17
Daily,
18
};
19
20
struct
ArchiveNameInfo
{
21
data::TmWithMs
time;
22
size_t
index;
23
RotateInterval interval;
24
};
25
26
struct
RotateConfig
{
27
bool
rotateOnOpen =
true
;
28
uint64 maxFileSize = 32ull * 1024 * 1024;
29
RotateInterval interval = RotateInterval::Daily;
30
bool
compress =
true
;
31
size_t
keepUncompressed = 7;
32
bool
cleanup =
true
;
33
size_t
maxFiles = 1024;
34
int
maxAgeDays = 120;
35
uint64 totalSizeCap = 512ull * 1024 * 1024;
36
};
37
38
class
RotatePolicy :
public
RotateConfig
{
39
public
:
40
RotatePolicy() =
default
;
41
RotatePolicy(
RotateConfig
const
& config) :
RotateConfig
(config) {}
42
43
LLNDAPI
static
std::string defaultNamer(
ArchiveNameInfo
const
& info);
44
45
std::function<std::string(
ArchiveNameInfo
const
&)> namer{&defaultNamer};
46
47
LLNDAPI
static
RotatePolicy disabled();
48
};
49
50
}
// namespace ll::io
ll::data::TmWithMs
Definition
TmWithMs.h:11
ll::io::ArchiveNameInfo
Definition
RotatePolicy.h:20
ll::io::RotateConfig
Definition
RotatePolicy.h:26
src
ll
api
io
RotatePolicy.h
Generated on
for LeviLamina by
1.16.1