Skip to content
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

Create log_snakemake() function #35

Merged
merged 22 commits into from
Jul 13, 2022
Merged

Create log_snakemake() function #35

merged 22 commits into from
Jul 13, 2022

Conversation

kelly-sovacool
Copy link
Member

@kelly-sovacool kelly-sovacool commented Jun 30, 2022

Change(s) made

  • Created log_snakemake(), which redirects output to a log file when it is called from a Snakemake rule and a rule-specific log file is defined.
  • Wrote a unit test to check that log_snakemake() reports that no log file exists if that's the case and quiet = FALSE. However, it doesn't seem possible to test that it creates a log file with sink(), as testthat seems to prevent that from happening. It does work when run from the console.

Checklist

(Strikethrough any points that are not applicable.)

  • Write unit tests for any new functionality.
  • Update roxygen comments & vignettes if there are any API changes.
  • Update NEWS.md if this includes any user-facing changes.
  • The check workflow succeeds on your most recent commit.

@kelly-sovacool kelly-sovacool requested review from a team and sklucas and removed request for a team June 30, 2022 18:09
@kelly-sovacool kelly-sovacool marked this pull request as ready for review June 30, 2022 18:09
@kelly-sovacool kelly-sovacool marked this pull request as draft July 13, 2022 18:00
@kelly-sovacool kelly-sovacool marked this pull request as ready for review July 13, 2022 18:08
Copy link
Member

@sklucas sklucas left a comment

Choose a reason for hiding this comment

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

Seems like a really useful function!

@sklucas sklucas merged commit f6a4711 into main Jul 13, 2022
@sklucas sklucas deleted the log-smk branch July 13, 2022 18:15
@kelly-sovacool
Copy link
Member Author

@sklucas I have been copy-pasting it into my Snakemake + R projects so often that it became absurd for it to not be in a package somewhere. Many thanks!

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.

None yet

2 participants