docs
Docs
C++ API
C API
Search API
Ctrl K
2.0
2.0
latest
1.4
Ultralight C++ API
2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
Logger.h
Go to the documentation of this file.
1
///
2
/// Copyright (C) 2026 Ultralight, Inc. All rights reserved.
3
/// A license is required for commercial use. https://ultralig.ht
4
///
5
#pragma once
6
#include <
Ultralight/Defines.h
>
7
#include <
Ultralight/String.h
>
8
9
namespace
ultralight
{
10
11
///
12
/// The severity of a log message, from most to least severe.
13
///
14
/// @see DiagnosticsConfig::min_log_level
15
///
16
enum class
LogLevel
: uint8_t {
17
///
18
/// The application can't continue (eg, a failed device or startup, missing ICU data, or a
19
/// required platform interface that wasn't set).
20
///
21
Fatal
,
22
23
///
24
/// A failure the library recovers from (eg, a resource that failed to load).
25
///
26
Error
,
27
28
///
29
/// A problem or diagnostic that isn't a failure (eg, a misused API call).
30
///
31
Warning
,
32
33
///
34
/// Status information.
35
///
36
Info
,
37
38
///
39
/// Verbose detail (not sent unless you lower DiagnosticsConfig::min_log_level to Debug).
40
///
41
Debug
,
42
};
43
44
///
45
/// User-defined logging interface.
46
///
47
/// The library uses this to report failures, warnings, and status messages.
48
///
49
/// This is intended to be implemented by users and defined before creating the Renderer.
50
///
51
/// Each message starts with a tag in brackets for the part of the library it came from (eg,
52
/// `[net] Failed to load cacert.pem ...`). The library doesn't send messages below
53
/// DiagnosticsConfig::min_log_level.
54
///
55
/// @note The library calls LogMessage() from any of its threads, and more than one can be inside
56
/// it at the same time, so your implementation **must** serialize its writes.
57
///
58
/// @see Platform::set_logger()
59
///
60
class
UExport
Logger
{
61
public
:
62
virtual
~Logger
();
63
64
///
65
/// Called when the library wants to display a log message.
66
///
67
/// @param log_level The severity of the message.
68
///
69
/// @param message The message text.
70
///
71
virtual
void
LogMessage
(
LogLevel
log_level,
const
String
& message) = 0;
72
};
73
74
}
// namespace ultralight
UExport
#define UExport
Definition
Exports.h:22
String.h
Defines.h
ultralight::Logger
User-defined logging interface.
Definition
Logger.h:60
ultralight::Logger::~Logger
virtual ~Logger()
ultralight::Logger::LogMessage
virtual void LogMessage(LogLevel log_level, const String &message)=0
Called when the library wants to display a log message.
ultralight::String
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
Definition
String.h:31
ultralight
Root namespace for every public Ultralight type, function, and enumeration.
ultralight::LogLevel
LogLevel
The severity of a log message, from most to least severe.
Definition
Logger.h:16
ultralight::LogLevel::Fatal
@ Fatal
The application can't continue (eg, a failed device or startup, missing ICU data, or a required platf...
Definition
Logger.h:21
ultralight::LogLevel::Debug
@ Debug
Verbose detail (not sent unless you lower DiagnosticsConfig::min_log_level to Debug).
Definition
Logger.h:41
ultralight::DialogIcon::Warning
@ Warning
Warning icon.
Definition
Dialogs.h:56
ultralight::DialogIcon::Info
@ Info
Information icon.
Definition
Dialogs.h:55
ultralight::DialogIcon::Error
@ Error
Error icon.
Definition
Dialogs.h:57
Ultralight
platform
Logger.h
Docs
C++ API
C API
Version
2.0
2.0
latest
1.4