-
Notifications
You must be signed in to change notification settings - Fork 296
fix: Print UDF stdout and Daft logs above the progress bar #4861
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
Merged
Merged
Changes from 45 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
3473ec3
Test on CI
srilman 62b118c
Fix for testing
srilman 42dc29e
Merge branch 'main' into slade/parallel-stateless-udfs
srilman 86fa79c
Figure out proto
srilman 951f3c9
Compiling
srilman 835d7d1
More issues
srilman 6b36b46
Merge branch 'main' into slade/parallel-stateless-udfs
srilman 7578bac
Fix merge conflicts
srilman 7a59ad1
Undo rename
srilman fc33728
Override v1 proto instead
srilman a633ee0
Should be failing doctests
srilman efcf890
Fix rust tests
srilman 1405f9f
Merge with main
srilman a8074aa
Merge branch 'main' into slade/parallel-stateless-udfs
srilman 3d82a52
Merge branch 'main' into slade/parallel-stateless-udfs
srilman 2291acf
Passing tests
srilman b9326dd
Try on CI again
srilman c6d2dba
Found issue
srilman 479f62a
Forgot to undo old change
srilman 81480a3
Fixed the passing issue
srilman e2b7e7a
Merge branch 'main' into slade/parallel-stateless-udfs
srilman 930ed82
First
srilman eb55002
Merge branch 'main' into slade/parallel-stateless-udfs
srilman 4c865a4
Addressed comments and CI
srilman 5d6d4b8
Addressed comments and CI
srilman a27063b
Fix tests
srilman 9f2f308
Fix the last issue
srilman 1abece9
Come on
srilman bcaf7ec
Fix last
srilman 497841f
One more change
srilman abb3a99
Another Cleanup
srilman 053c3d2
Ok
srilman 2d19f45
Sink Names
srilman eb9d506
Save temp
srilman 8b38561
Merge branch 'main' into slade/pbar-logging
srilman 6307c2f
Fix CI
srilman 3683aaa
Testing
srilman b61b550
Fix the flotilla issue
srilman f87bf03
Fix thread logging but it sucks
srilman e414d5f
Merge branch 'main' into slade/pbar-logging
srilman 7324155
Merge branch 'main' into slade/pbar-logging
srilman 032d583
Addressed comments
srilman c26453a
Merge branch 'main' into slade/pbar-logging
srilman a4e2f40
Fix the segfault
srilman 040920a
Yeahhhhh
srilman 1ef2414
Not sure why but OK
srilman 729f8c2
Removed the threaded aspects
srilman 79774d3
Address comments
srilman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[dependencies] | ||
arc-swap = {workspace = true} | ||
log = {workspace = true} | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[package] | ||
edition = {workspace = true} | ||
name = "common-logging" | ||
version = {workspace = true} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
use std::sync::{Arc, LazyLock}; | ||
|
||
use arc_swap::ArcSwap; | ||
use log::Log; | ||
|
||
/// A logger that can be internally modified at runtime. | ||
/// Usually, loggers can only be initialized once, but this container can | ||
/// swap out the internal logger at runtime atomically. | ||
pub struct SwappableLogger { | ||
base: ArcSwap<Box<dyn Log + Send + Sync + 'static>>, | ||
temp: ArcSwap<Option<Box<dyn Log + Send + Sync + 'static>>>, | ||
} | ||
|
||
impl SwappableLogger { | ||
pub fn new(logger: Box<dyn Log + Send + Sync + 'static>) -> Self { | ||
Self { | ||
base: ArcSwap::new(Arc::new(logger)), | ||
temp: ArcSwap::new(Arc::new(None)), | ||
} | ||
} | ||
|
||
pub fn set_base_logger(&self, logger: Box<dyn Log + Send + Sync + 'static>) { | ||
self.base.store(Arc::new(logger)); | ||
} | ||
|
||
pub fn get_base_logger(&self) -> Arc<Box<dyn Log + Send + Sync + 'static>> { | ||
self.base.load().to_owned() | ||
} | ||
|
||
pub fn set_temp_logger(&self, logger: Box<dyn Log + Send + Sync + 'static>) { | ||
self.temp.store(Arc::new(Some(logger))); | ||
} | ||
|
||
pub fn reset_temp_logger(&self) { | ||
self.temp.store(Arc::new(None)); | ||
} | ||
} | ||
|
||
impl Log for SwappableLogger { | ||
fn enabled(&self, metadata: &log::Metadata) -> bool { | ||
if let Some(temp) = self.temp.load().as_ref() { | ||
temp.enabled(metadata) | ||
} else { | ||
self.base.load().enabled(metadata) | ||
} | ||
} | ||
|
||
fn log(&self, record: &log::Record) { | ||
if let Some(temp) = self.temp.load().as_ref() { | ||
temp.log(record); | ||
} else { | ||
self.base.load().log(record); | ||
} | ||
} | ||
|
||
fn flush(&self) { | ||
if let Some(temp) = self.temp.load().as_ref() { | ||
temp.flush(); | ||
} else { | ||
self.base.load().flush(); | ||
} | ||
} | ||
} | ||
|
||
/// A Noop logger that does nothing. | ||
/// Used for initialization purposes only, should never actually be used. | ||
struct NoopLogger; | ||
|
||
impl Log for NoopLogger { | ||
fn enabled(&self, _metadata: &log::Metadata) -> bool { | ||
false | ||
} | ||
|
||
fn log(&self, _record: &log::Record) {} | ||
|
||
fn flush(&self) {} | ||
} | ||
|
||
/// The global logger that can be swapped out at runtime. | ||
/// This is initialized to a NoopLogger to avoid any logging during initialization. | ||
/// It can be swapped out with a real logger using `set_inner_logger`. | ||
pub static GLOBAL_LOGGER: LazyLock<Arc<SwappableLogger>> = | ||
LazyLock::new(|| Arc::new(SwappableLogger::new(Box::new(NoopLogger)))); |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.