Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through OE logging, 5.0.14 release notes #6888

Merged
merged 2 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

- `ccf.ledger`/`read_ledger.py` previously enforced too strict a condition on node membership when validating ledger files (#6849).
- Removed default value for redirection-kind parameter to start_network script (#6887).
- Don't throw error if the ledger directory exists but is empty on node start (#6885).
- Open Enclave logs directly to standard output, without restriction.

## [5.0.13]

Expand Down
1 change: 1 addition & 0 deletions edl/ccf.edl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the Apache 2.0 License.

enclave {
from "openenclave/edl/logging.edl" import *;
from "openenclave/edl/sgx/platform.edl" import *;
from "openenclave/edl/time.edl" import *;

Expand Down
37 changes: 0 additions & 37 deletions include/ccf/pal/enclave.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace ccf::pal
{
#if !defined(INSIDE_ENCLAVE) || defined(VIRTUAL_ENCLAVE)

static inline void redirect_platform_logging() {}

static inline void initialize_enclave() {}

static inline void shutdown_enclave() {}
Expand All @@ -29,41 +27,6 @@ namespace ccf::pal

#else

static void open_enclave_logging_callback(
void* context,
oe_log_level_t level,
uint64_t thread_id,
const char* message)
{
switch (level)
{
case OE_LOG_LEVEL_FATAL:
CCF_LOG_FMT(FATAL, "")("OE: {}", message);
break;
case OE_LOG_LEVEL_ERROR:
CCF_LOG_FMT(FAIL, "")("OE: {}", message);
break;
case OE_LOG_LEVEL_WARNING:
CCF_LOG_FMT(FAIL, "")("OE: {}", message);
break;
case OE_LOG_LEVEL_INFO:
CCF_LOG_FMT(INFO, "")("OE: {}", message);
break;
case OE_LOG_LEVEL_VERBOSE:
CCF_LOG_FMT(DEBUG, "")("OE: {}", message);
break;
case OE_LOG_LEVEL_MAX:
case OE_LOG_LEVEL_NONE:
CCF_LOG_FMT(TRACE, "")("OE: {}", message);
break;
}
}

static inline void redirect_platform_logging()
{
oe_enclave_log_set_callback(nullptr, &open_enclave_logging_callback);
}

static inline void initialize_enclave()
{
auto rc = oe_attester_initialize();
Expand Down
2 changes: 0 additions & 2 deletions src/enclave/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ extern "C"
auto ringbuffer_logger = new_logger.get();
ccf::logger::config::loggers().push_back(std::move(new_logger));

ccf::pal::redirect_platform_logging();

enclave_sanity_checks();

{
Expand Down
19 changes: 0 additions & 19 deletions src/host/enclave.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@
# include "enclave/virtual_enclave.h"
#endif

extern "C"
{
#ifdef PLATFORM_SGX
void nop_oe_logger(
void* context,
bool is_enclave,
const struct tm* t,
long int usecs,
oe_log_level_t level,
uint64_t host_thread_id,
const char* message)
{}
#endif
}

namespace host
{
void expect_enclave_file_suffix(
Expand Down Expand Up @@ -128,10 +113,6 @@ namespace host
expect_enclave_file_suffix(path, ".enclave.so.signed", type);
}

# ifdef CCF_DISABLE_VERBOSE_LOGGING
oe_log_set_callback(nullptr, nop_oe_logger);
# endif

auto err = oe_create_ccf_enclave(
path.c_str(),
OE_ENCLAVE_TYPE_SGX,
Expand Down
4 changes: 1 addition & 3 deletions tests/infra/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,7 @@ def __init__(
snp_uvm_security_context_dir
)

oe_log_level = CCF_TO_OE_LOG_LEVEL.get(kwargs.get("host_log_level"))
if oe_log_level:
env["OE_LOG_LEVEL"] = oe_log_level
env["OE_LOG_LEVEL"] = "INFO"

self.name = f"{label}_{local_node_id}"
self.start_type = start_type
Expand Down