IceShard
1
A personal game engine project, with development focused on 2D/2.5D games.
Toggle main menu visibility
Loading...
Searching...
No Matches
logger
public
ice
log_tag.hxx
Go to the documentation of this file.
1
3
4
#pragma once
5
#include <
ice/hash.hxx
>
6
#include <
ice/string.hxx
>
7
8
namespace
ice
9
{
10
11
enum class
LogTag
:
ice::u64
12
{
13
None
= 0x0,
14
15
Core
= 0x1ull << 0,
16
System
=
Core
<< 1,
17
Module
=
Core
<< 2,
18
Engine
=
Core
<< 3,
19
Asset
=
Core
<< 4,
20
Game
=
Core
<< 5,
21
Tool
=
Core
<< 24,
22
};
23
24
struct
LogTagDefinition
25
{
26
ice::LogTag
const
tag
;
27
ice::String
const
name
;
28
};
29
30
constexpr
auto
create_log_tag
(
LogTag
base_tag,
ice::String
name)
noexcept
->
LogTagDefinition
31
{
32
ice::u64
const
name_hash =
ice::hash32
(name);
33
ice::u64
const
tag_hash =
ice::hash
(base_tag) << 32;
34
return
{
35
.tag =
static_cast<
LogTag
>
(tag_hash | name_hash),
36
.name = name
37
};
38
}
39
40
constexpr
auto
create_log_tag
(
LogTagDefinition
const
& base_tag_def,
ice::String
name)
noexcept
->
LogTagDefinition
41
{
42
return
create_log_tag
(base_tag_def.tag, name);
43
}
44
45
void
log_tag_register
(
ice::LogTagDefinition
tag_def)
noexcept
;
46
47
void
log_tag_enable
(
ice::LogTag
tag,
bool
enabled =
true
) noexcept;
48
49
namespace
detail
50
{
51
52
constexpr
auto
get_tag
(
ice::LogTag
tag)
noexcept
53
{
54
return
tag;
55
}
56
57
constexpr
auto
get_tag
(
ice::LogTagDefinition
const
& tag_def)
noexcept
58
{
59
return
tag_def.tag;
60
}
61
62
}
// namespace detail
63
64
}
// namespace ice
ice::Module
Base class for modules that will automatically register them to be loaded by the module manager.
Definition
module.hxx:17
hash.hxx
ice::detail
Definition
hashmap_details.hxx:13
ice::detail::get_tag
constexpr auto get_tag(ice::LogTag tag) noexcept
Definition
log_tag.hxx:52
ice
SPDX-License-Identifier: MIT.
Definition
array.hxx:12
ice::String
ice::BasicString< char > String
Definition
string.hxx:82
ice::LogSeverity::None
@ None
Definition
log_severity.hxx:21
ice::log_tag_enable
void log_tag_enable(ice::LogTag tag, bool enabled=true) noexcept
ice::u64
std::uint64_t u64
Definition
types.hxx:27
ice::hash32
constexpr auto hash32(ice::String value) noexcept -> ice::u32
Definition
string.hxx:105
ice::LogTag
LogTag
Definition
log_tag.hxx:12
ice::LogTag::Asset
@ Asset
Definition
log_tag.hxx:19
ice::LogTag::Game
@ Game
Definition
log_tag.hxx:20
ice::LogTag::Engine
@ Engine
Definition
log_tag.hxx:18
ice::LogTag::Core
@ Core
Definition
log_tag.hxx:15
ice::LogTag::System
@ System
Definition
log_tag.hxx:16
ice::LogTag::Tool
@ Tool
Definition
log_tag.hxx:21
ice::hash
constexpr auto hash(ice::HeapString<> const &value) noexcept -> ice::u64
Definition
heap_string.hxx:251
ice::create_log_tag
constexpr auto create_log_tag(LogTag base_tag, ice::String name) noexcept -> LogTagDefinition
Definition
log_tag.hxx:30
ice::log_tag_register
void log_tag_register(ice::LogTagDefinition tag_def) noexcept
string.hxx
ice::LogTagDefinition
Definition
log_tag.hxx:25
ice::LogTagDefinition::tag
ice::LogTag const tag
Definition
log_tag.hxx:26
ice::LogTagDefinition::name
ice::String const name
Definition
log_tag.hxx:27
Generated by
1.18.0