Skip to content

Commit

Permalink
Merge pull request #200 from ORNL/empty-log-file
Browse files Browse the repository at this point in the history
Empty log file
  • Loading branch information
renan-souza authored Jan 13, 2025
2 parents ce9b8c8 + 503c82e commit 09769a8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 25 deletions.
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

0 comments on commit 09769a8

Please sign in to comment.