FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add implementation for new ABI proxy_log_destination by vikaschoudhary16 · Pull Request #336 · proxy-wasm/proxy-wasm-cpp-host · GitHub

Add implementation for new ABI proxy_log_destination - #336

Open
vikaschoudhary16 wants to merge 3 commits into
proxy-wasm:mainfrom
vikaschoudhary16:log-destination
Open

Add implementation for new ABI proxy_log_destination#336
vikaschoudhary16 wants to merge 3 commits into
proxy-wasm:mainfrom
vikaschoudhary16:log-destination

Conversation

vikaschoudhary16 commented Mar 27, 2023
edited
Loading

Copy link
Copy Markdown

Implements proxy-wasm/spec#38.

@PiotrSikora @mathetake @anuraaga please see if going in right direction overall. Will add unit tests once confirmed.
I have tested the changes manually. Related changes in envoy, envoyproxy/envoy#26364

xref: envoyproxy/envoy#22669

Signed-off-by: Vikas Choudhary <choudharyvikas16@gmail.com>
Comment thread src/exports.cc Outdated
if (e.first == dest.value()) {
// write message to the file which is the value of the key if it exists
std::ofstream log_file;
log_file.open(e.second, std::ios::out | std::ios_base::app);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

IMHO, this should be done on the proxy-side, so that it can use optimized logging facilities (if they exist), work with sandboxing, etc.

Basically, this whole block could be replaced with:

context->log_with_destination(level, message.value(), dest.value());

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

updated, thanks!

Comment thread src/exports.cc Outdated
if (!dest) {
return WasmResult::InvalidMemoryAccess;
}
context->log(level, dest.value());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Debug leftover?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

yes. thanks for catching

Signed-off-by: Vikas Choudhary <choudharyvikas16@gmail.com>
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL