forked from nodegui/nodegui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlog.cpp
More file actions
46 lines (38 loc) · 1.18 KB
/
log.cpp
File metadata and controls
46 lines (38 loc) · 1.18 KB
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
38
39
40
41
42
43
44
45
46
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "log.h"
#include "YGConfig.h"
#include "YGNode.h"
#include "Yoga.h"
namespace facebook {
namespace yoga {
namespace detail {
namespace {
void vlog(YGConfig* config, YGNode* node, YGLogLevel level, void* context,
const char* format, va_list args) {
YGConfig* logConfig = config != nullptr ? config : YGConfigGetDefault();
logConfig->log(logConfig, node, level, context, format, args);
}
} // namespace
YOGA_EXPORT void Log::log(YGNode* node, YGLogLevel level, void* context,
const char* format, ...) noexcept {
va_list args;
va_start(args, format);
vlog(node == nullptr ? nullptr : node->getConfig(), node, level, context,
format, args);
va_end(args);
}
void Log::log(YGConfig* config, YGLogLevel level, void* context,
const char* format, ...) noexcept {
va_list args;
va_start(args, format);
vlog(config, nullptr, level, context, format, args);
va_end(args);
}
} // namespace detail
} // namespace yoga
} // namespace facebook