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
37
//! TOML tables are typed maps.
//! TOMLのテーブルは型付きのマップだ。
use casual_logger::{Log, Table};
fn main() {
Log::set_file_name("today-s-plan");
Log::remove_old_logs();
// Just add'_t'.
// '_t' を付けただけ。
Log::info_t(
"ShoppingToday", // A-Z, a-z, 0-9, _, -.
Table::default()
// Japanese YEN.
// 日本円。
.int("FluorescentLight", -7_000)
.int("VacuumCleaner", -53_000)
// '.literal()' is no validate. carefully.
// 構文チェックされません。慎重に。
.literal(
"VacuumCleanerPricesAtOtherStores",
"[ -63_000, -4_000, -10_000 ]",
)
.int("Rent", -40_000)
.uint("Salary", 190_000)
.str(
"Remark",
"Buy shelves in the near month.
Replace the washing machine after a few years.
近い月に棚。
数年後に洗濯機買い替え。",
),
);
Log::flush();
}