logger in editor
This commit is contained in:
parent
59ff3ead93
commit
d28c0157d8
@ -52,8 +52,10 @@ def _rename_dialog(file_path: str):
|
|||||||
if st.session_state.active_file == file_path:
|
if st.session_state.active_file == file_path:
|
||||||
st.session_state.active_file = new_file_path
|
st.session_state.active_file = new_file_path
|
||||||
st.rerun()
|
st.rerun()
|
||||||
|
logger.info("Rename file %s to %s successfull", file_path, new_name )
|
||||||
else:
|
else:
|
||||||
st.error("Rename failed. Check that the file still exists.")
|
logger.warning("Rename failed.")
|
||||||
|
st.error("Rename failed. Check that the file %s still exists.", file_path)
|
||||||
with col2:
|
with col2:
|
||||||
if st.button("Cancel", use_container_width=True):
|
if st.button("Cancel", use_container_width=True):
|
||||||
st.rerun()
|
st.rerun()
|
||||||
@ -78,8 +80,10 @@ def _delete_dialog(abs_file_path: str):
|
|||||||
if st.session_state.open_files else None
|
if st.session_state.open_files else None
|
||||||
)
|
)
|
||||||
st.rerun()
|
st.rerun()
|
||||||
|
logger.info("Deleting file %s successfull.", abs_file_path)
|
||||||
else:
|
else:
|
||||||
st.error("Delete failed. Check that the file still exists.")
|
st.error("Delete failed. Check that the file still exists.")
|
||||||
|
logger.warning("Deleting file %s failed.", abs_file_path)
|
||||||
with col2:
|
with col2:
|
||||||
if st.button("Cancel", use_container_width=True):
|
if st.button("Cancel", use_container_width=True):
|
||||||
st.rerun()
|
st.rerun()
|
||||||
@ -97,18 +101,16 @@ def run_active_file():
|
|||||||
return
|
return
|
||||||
|
|
||||||
execution_engine = ExecutionEngine()
|
execution_engine = ExecutionEngine()
|
||||||
debug_logger = DebugLogger()
|
|
||||||
|
logger.info("Executing code from %s...", active_file)
|
||||||
debug_logger.clear()
|
|
||||||
debug_logger.log(f"Executing code from {active_file}...")
|
|
||||||
|
|
||||||
with st.spinner(f"Running {Path(active_file).name}..."):
|
with st.spinner(f"Running {Path(active_file).name}..."):
|
||||||
output = execution_engine.run_code(Path(active_file))
|
output = execution_engine.run_code(Path(active_file))
|
||||||
|
|
||||||
if output["rc"] == 0:
|
if output["rc"] == 0:
|
||||||
debug_logger.log("Execution completed successfully.")
|
logger.info("Execution completed successfully.")
|
||||||
else:
|
else:
|
||||||
debug_logger.log_error(f"Execution failed with exit code {output['rc']}.")
|
logger.error("Execution failed with exit code %s.", output['rc'])
|
||||||
|
|
||||||
st.session_state.code_execution_output = {
|
st.session_state.code_execution_output = {
|
||||||
"stdout": output["stdout"],
|
"stdout": output["stdout"],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user