Skip to content

Commit

Permalink
enable full logging with -v (PR #26)
Browse files Browse the repository at this point in the history
* fix #25 
* enable full logging at INFO when -v (verbose) is requested
* Update CHANGES
  • Loading branch information
xiki-tempula authored Dec 11, 2022
1 parent d335d4e commit 726628c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
11 changes: 10 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,24 @@ The rules for this file:
* release numbers follow "Semantic Versioning" https://semver.org

------------------------------------------------------------------------------
2022-??-?? xiki-tempula

* 0.3.2

Fixes

- enable logger output for -v (issue #25)


2022-12-06 xiki-tempula, hejamu

* 0.3.1

Fixes
Fixes

- Handle 0 as input to the forwrev (Issue #18/ PR #20).


2022-11-09 xiki-tempula, orbeckst

* 0.3.0
Expand Down
5 changes: 4 additions & 1 deletion flamel/flamel.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ def main():

# Print the logging to the console
if args.verbose:
logging.getLogger().addHandler(logging.StreamHandler())
logging.basicConfig(
level=logging.INFO,
handlers=[logging.StreamHandler()],
)

if args.output_directory == "":
out = args.datafile_directory
Expand Down
12 changes: 12 additions & 0 deletions flamel/tests/test_flamel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import sys
import pathlib
import pickle
import subprocess

import pytest
from numpy.testing import assert_approx_equal
Expand Down Expand Up @@ -47,6 +48,17 @@ def test_dhdl_TI(self, setup):
assert (setup / "dhdl_TI.pdf").exists()


def test_verbose():
p = subprocess.Popen(
["flamel", "-v"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
out, err = p.communicate()
assert (
"INFO:alchemlyb.workflows.ABFE:Initialise Alchemlyb ABFE Workflow"
in err.decode()
)


class TestFlamelOptions(TestFlamel):
@staticmethod
@pytest.fixture(scope="session")
Expand Down

0 comments on commit 726628c

Please sign in to comment.