Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

sandbox: better log output #43325

Closed
wants to merge 1 commit into from
Closed

sandbox: better log output #43325

wants to merge 1 commit into from

Conversation

xu-cheng
Copy link
Member

  • use syslog filter instead of grep.
  • output sandbox log to stdout when verbose and failed.
  • output nothing if sandbox log is empty.

cc @MikeMcQuaid

puts Sandbox.log_warning_message
puts logs
ohai "Sandbox profile:"
puts @profile.dump
Copy link
Member

Choose a reason for hiding this comment

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

Do you find this message useful? If so we can keep it otherwise let's 💀

Copy link
Member Author

Choose a reason for hiding this comment

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

It's useful to people who are unfamiliar to homebrew sandbox's rule. Otherwise, it's not as they are almost constant.

Copy link
Member

Choose a reason for hiding this comment

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

Yeh, I guess I personally find this output kinda noise and hard to follow. Maybe we could add a few newlines or separators in here to split it up a bit if we leave it in?

Copy link
Member Author

Choose a reason for hiding this comment

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

Or we remove this. And add it to document, say sandbox.md?

Copy link
Member

Choose a reason for hiding this comment

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

Yeh, maybe just remove it? A document will get outdated compared to the code.

@xu-cheng
Copy link
Member Author

Rewrote PR to address the comments.

def self.log_warning_message; <<-EOS.undent
We use time to filter sandbox log. Therefore, unrelated logs may be recorded in below.

EOS
end
Copy link
Member

Choose a reason for hiding this comment

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

I think we can probably skip printing this message unless it's causing confusion.

Copy link
Member Author

Choose a reason for hiding this comment

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

How about only writing it to log file? Usually there won't be unrelated logs for bot. But on users computer, the chance is high which can cause confusion.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, if we write it maybe after we print the log then that makes sense to me. Equally if we didn't write it if HOMEBREW_DEVELOPER is set or something? Up to you!

Copy link
Member Author

Choose a reason for hiding this comment

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

Finally, I decide to only write this message to the bottom of file.

@MikeMcQuaid
Copy link
Member

Looks good to me!

* use syslog filter instead of grep.
* output sandbox log to stdout when verbose and failed.
* output nothing if sandbox log is empty.
@MikeMcQuaid
Copy link
Member

👍

@xu-cheng xu-cheng closed this in 31b4892 Aug 28, 2015
@xu-cheng xu-cheng deleted the sandbox-log branch August 28, 2015 09:34
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants