-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sunhe05
committed
Mar 3, 2023
1 parent
80101df
commit 5e74240
Showing
23 changed files
with
427 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
[package] | ||
name = "teaclave_logger" | ||
version = "0.4.0" | ||
authors = ["Teaclave Contributors <dev@teaclave.apache.org>"] | ||
description = "Teaclave worker" | ||
license = "Apache-2.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "teaclave_logger" | ||
crate-type = ["staticlib", "rlib"] | ||
|
||
[features] | ||
default = ["mesalock_sgx"] | ||
mesalock_sgx = [] | ||
cov = ["sgx_cov"] | ||
enclave_unit_test = ["teaclave_test_utils/mesalock_sgx"] | ||
|
||
[dependencies] | ||
anyhow = { version = "1.0.26" } | ||
log = { version = "0.4.17", features = ["release_max_level_info", "kv_unstable_std"] } | ||
|
||
teaclave_test_utils = { path = "../tests/utils", optional = true } | ||
|
||
sgx_cov = { version = "2.0.0", optional = true } | ||
|
||
[target.'cfg(not(target_vendor = "teaclave"))'.dependencies] | ||
sgx_types = { version = "2.0.0" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
permalink: /docs/codebase/logger | ||
--- | ||
|
||
# Logger | ||
|
||
A logger for Teaclave services. It can collect logs to a buffer. | ||
Logs not saved to buffer can be logged by another logger that | ||
implements `log` trait. | ||
|
||
## Task logging | ||
|
||
When the logger is imported in the `execution service`, it can send the logs | ||
during a task to a buffer. The `kv_unstable` feature in the `log` crate is used | ||
to pass the pointer to the buffer to the logger. After the buffer is set, the | ||
logger will save logs to the buffer. The logger will drop the task logger after | ||
receiving a null pointer. Another logger which we call `secondary logger` will | ||
handle the logs coming afterwards if it is set. The logs before the task starts | ||
are sent to the secondary logger as well. |
Oops, something went wrong.