Skip to content

Conversation

@shayne-fletcher
Copy link
Contributor

Summary:
remove manual config save/restore boilerplate:

  config = get_configuration()
  enable_log_forwarding = config["enable_log_forwarding"]
  # ... etc
  configure(enable_log_forwarding=True, ...)
  try:
      # test code
  finally:
      configure(enable_log_forwarding=enable_log_forwarding, ...)

replace with context manager phrasing:

  with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100):
      # test code

i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection

Differential Revision: D87478665

…1932)

Summary:

replace env-var overrides with `configure`. relax `test_flush_logs_ipython` which before was over-constrained and consequently, highly flaky.

Reviewed By: mariusae

Differential Revision: D87449483
Summary:
remove manual config save/restore boilerplate:
```
  config = get_configuration()
  enable_log_forwarding = config["enable_log_forwarding"]
  # ... etc
  configure(enable_log_forwarding=True, ...)
  try:
      # test code
  finally:
      configure(enable_log_forwarding=enable_log_forwarding, ...)
```
replace with context manager phrasing:
```
  with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100):
      # test code
```
i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection

Differential Revision: D87478665
@meta-codesync
Copy link

meta-codesync bot commented Nov 19, 2025

@shayne-fletcher has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87478665.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 19, 2025
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 20, 2025
…ch#1946)

Summary:

following up on mariusae 's comment (https://www.internalfb.com/diff/D87449483?dst_version_fbid=2613910452329247&transaction_fbid=2002832840481448)

remove manual config save/restore boilerplate:
```
  config = get_configuration()
  enable_log_forwarding = config["enable_log_forwarding"]
  # ... etc
  configure(enable_log_forwarding=True, ...)
  try:
      # test code
  finally:
      configure(enable_log_forwarding=enable_log_forwarding, ...)
```
replace with a context manager phrasing:
```
  with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100):
      # test code
```
i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection

Reviewed By: thedavekwon

Differential Revision: D87478665
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 20, 2025
…ch#1946)

Summary:

following up on mariusae 's comment (https://www.internalfb.com/diff/D87449483?dst_version_fbid=2613910452329247&transaction_fbid=2002832840481448)

remove manual config save/restore boilerplate:
```
  config = get_configuration()
  enable_log_forwarding = config["enable_log_forwarding"]
  # ... etc
  configure(enable_log_forwarding=True, ...)
  try:
      # test code
  finally:
      configure(enable_log_forwarding=enable_log_forwarding, ...)
```
replace with a context manager phrasing:
```
  with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100):
      # test code
```
i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection

Reviewed By: thedavekwon

Differential Revision: D87478665
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 20, 2025
…ch#1946)

Summary:

following up on mariusae 's comment (https://www.internalfb.com/diff/D87449483?dst_version_fbid=2613910452329247&transaction_fbid=2002832840481448)

remove manual config save/restore boilerplate:
```
  config = get_configuration()
  enable_log_forwarding = config["enable_log_forwarding"]
  # ... etc
  configure(enable_log_forwarding=True, ...)
  try:
      # test code
  finally:
      configure(enable_log_forwarding=enable_log_forwarding, ...)
```
replace with a context manager phrasing:
```
  with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100):
      # test code
```
i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection

Reviewed By: thedavekwon

Differential Revision: D87478665
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 20, 2025
…ch#1946)

Summary:

following up on mariusae 's comment (https://www.internalfb.com/diff/D87449483?dst_version_fbid=2613910452329247&transaction_fbid=2002832840481448)

remove manual config save/restore boilerplate:
```
  config = get_configuration()
  enable_log_forwarding = config["enable_log_forwarding"]
  # ... etc
  configure(enable_log_forwarding=True, ...)
  try:
      # test code
  finally:
      configure(enable_log_forwarding=enable_log_forwarding, ...)
```
replace with a context manager phrasing:
```
  with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100):
      # test code
```
i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection

Reviewed By: thedavekwon

Differential Revision: D87478665
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 20, 2025
…ch#1946)

Summary:

following up on mariusae 's comment (https://www.internalfb.com/diff/D87449483?dst_version_fbid=2613910452329247&transaction_fbid=2002832840481448)

remove manual config save/restore boilerplate:
```
  config = get_configuration()
  enable_log_forwarding = config["enable_log_forwarding"]
  # ... etc
  configure(enable_log_forwarding=True, ...)
  try:
      # test code
  finally:
      configure(enable_log_forwarding=enable_log_forwarding, ...)
```
replace with a context manager phrasing:
```
  with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100):
      # test code
```
i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection

Reviewed By: thedavekwon

Differential Revision: D87478665
shayne-fletcher added a commit to shayne-fletcher/monarch-1 that referenced this pull request Nov 20, 2025
…ch#1946)

Summary:

following up on mariusae 's comment (https://www.internalfb.com/diff/D87449483?dst_version_fbid=2613910452329247&transaction_fbid=2002832840481448)

remove manual config save/restore boilerplate:
```
  config = get_configuration()
  enable_log_forwarding = config["enable_log_forwarding"]
  # ... etc
  configure(enable_log_forwarding=True, ...)
  try:
      # test code
  finally:
      configure(enable_log_forwarding=enable_log_forwarding, ...)
```
replace with a context manager phrasing:
```
  with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100):
      # test code
```
i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection

Reviewed By: thedavekwon

Differential Revision: D87478665
@meta-codesync meta-codesync bot closed this in 068c505 Nov 20, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 20, 2025

This pull request has been merged in 068c505.

AlirezaShamsoshoara pushed a commit to AlirezaShamsoshoara/monarch that referenced this pull request Nov 20, 2025
…#1946)

Summary:
Pull Request resolved: meta-pytorch#1946

following up on mariusae 's comment (https://www.internalfb.com/diff/D87449483?dst_version_fbid=2613910452329247&transaction_fbid=2002832840481448)

remove manual config save/restore boilerplate:
```
  config = get_configuration()
  enable_log_forwarding = config["enable_log_forwarding"]
  # ... etc
  configure(enable_log_forwarding=True, ...)
  try:
      # test code
  finally:
      configure(enable_log_forwarding=enable_log_forwarding, ...)
```
replace with a context manager phrasing:
```
  with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100):
      # test code
```
i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection

Reviewed By: thedavekwon

Differential Revision: D87478665

fbshipit-source-id: 80e65ee72be72ee1e7ee2aa352600566fc6f0e4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants