Skip to content

Commit 144aed6

Browse files
committed
Sanitised file paths in logs
1 parent 726022a commit 144aed6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/murfey/server/api/session_control.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ def get_foil_hole(
352352
def make_atlas_jpg(
353353
session_id: MurfeySessionID, atlas_mrc: StringOfPathModel, db=murfey_db
354354
):
355-
logger.debug(f"Received request to create JPG image of atlas {atlas_mrc.path!r}")
355+
logger.debug(
356+
f"Received request to create JPG image of atlas {sanitise(atlas_mrc.path)!r}"
357+
)
356358
session = db.exec(select(Session).where(Session.id == session_id)).one()
357359
return atlas_jpg_from_mrc(
358360
session.instrument_name, session.visit, Path(atlas_mrc.path)

src/murfey/workflows/spa/atlas.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
import PIL.Image
66
from werkzeug.utils import secure_filename
77

8+
from murfey.util import sanitise
89
from murfey.util.config import get_machine_config
910

1011
logger = logging.getLogger("murfey.workflows.spa.atlas")
1112

1213

1314
def atlas_jpg_from_mrc(instrument_name: str, visit_name: str, atlas_mrc: Path):
14-
logger.debug(f"Starting workflow to create JPG image of atlas {atlas_mrc}")
15+
logger.debug(
16+
f"Starting workflow to create JPG image of atlas {sanitise(str(atlas_mrc))}"
17+
)
1518
with mrcfile.open(atlas_mrc) as mrc:
1619
data = mrc.data
1720

0 commit comments

Comments
 (0)