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

Empty log file #200

Merged
merged 6 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions .github/workflows/run-checks.yml → .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
name: Linter, formatter, and docs checks
on: [pull_request]

permissions:
contents: read
on: pull_request

jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'CI Bot')"

checks:
runs-on: ubuntu-22.04
if: "!contains(github.event.head_commit.message, 'CI Bot')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "pip"

- name: Install package and dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff
python -m pip install .[docs]
pip install --upgrade pip
pip install ruff
pip install .[docs]

- name: Run linter and formatter checks using ruff
run: make checks
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,3 @@ tests:
.PHONY: tests-notebooks
tests-notebooks:
pytest --nbmake "notebooks/" --nbmake-timeout=600 --ignore=notebooks/dask_from_CLI.ipynb

.PHONY: tests-all
tests-all:
pytest
3 changes: 0 additions & 3 deletions src/flowcept/commons/daos/mq_dao/mq_dao_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def _bulk_publish(self, buffer, channel=MQ_CHANNEL, serializer=msgpack.dumps):
pipe = self._producer.pipeline()
for message in buffer:
try:
# self.logger.debug(
# f"Going to send Message:" f"\n\t[BEGIN_MSG]{message}\n[END_MSG]\t"
# )
pipe.publish(MQ_CHANNEL, serializer(message))
except Exception as e:
self.logger.exception(e)
Expand Down
2 changes: 1 addition & 1 deletion src/flowcept/commons/flowcept_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _build_logger(cls):
logger.addHandler(stream_handler)

if file_level <= logging.CRITICAL:
file_handler = logging.FileHandler(LOG_FILE_PATH, mode="a+")
file_handler = logging.FileHandler(LOG_FILE_PATH, delay=True, mode="a+")
file_handler.setLevel(file_level)
file_format = logging.Formatter(f"[%(asctime)s]{_BASE_FORMAT}")
file_handler.setFormatter(file_format)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def observe(self):
f"I can't watch the file {self.settings.file_path}, as it does not exist."
)
self.logger.debug(
f"\tI will sleep for {self.settings.watch_interval_sec} sec. to see if it appears."
f"\tI will sleep for {self.settings.watch_interval_sec} s to see if it appears."
)
sleep(self.settings.watch_interval_sec)

Expand Down
6 changes: 3 additions & 3 deletions src/flowcept/flowceptor/consumers/document_inserter.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def flush_function(buffer, doc_daos, logger):
for dao in doc_daos:
dao.insert_and_update_many_tasks(buffer, TaskObject.task_id_field())
logger.debug(
f"DocDao={id(dao)},DocDaoClass={dao.__class__.__name__};"
f" Flushed {len(buffer)} msgs to this DocDB!"
f"DocDao={id(dao)},DocDaoClass={dao.__class__.__name__};\
Flushed {len(buffer)} msgs to this DocDB!"
) # TODO: add name

def _handle_task_message(self, message: Dict):
Expand Down Expand Up @@ -136,7 +136,7 @@ def _handle_task_message(self, message: Dict):
def _handle_workflow_message(self, message: Dict):
message.pop("type")
self.logger.debug(
f"Received following Workflow msg in DocInserter: \n\t[BEGIN_MSG]{message}\n[END_MSG]\t"
f"Received following Workflow msg in DocInserter:\n\t[BEGIN_MSG]{message}\n[END_MSG]\t"
)
if REMOVE_EMPTY_FIELDS:
remove_empty_fields_from_dict(message)
Expand Down
Loading