Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #40 from credo-ai/release/0.1.3
Browse files Browse the repository at this point in the history
Release/0.1.3
  • Loading branch information
IanAtCredo authored Jul 10, 2023
2 parents 6630944 + 445f04e commit 4be9720
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ pip install credoai-connect
## Documentation

Documentation is hosted by [readthedocs](https://credoai-connect.readthedocs.io/en/stable/).


## Logging
Logging defaults to stdout. In order to collect all logging information into a specific file,
set the desired location to the environment variable `CREDO_CONNECT_LOG_PATH`.



> **Warning**
> Make sure the destination has write permissions, otherwise you will get a `PermissionError` at the moment you
> attempt library import.
2 changes: 1 addition & 1 deletion connect/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = "0.1.2"
__version__ = "0.1.3"
6 changes: 4 additions & 2 deletions connect/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from io import StringIO
from logging import FileHandler, Formatter, Handler, StreamHandler, getLogger
from os.path import join
from os import getenv
from sys import stdout


Expand Down Expand Up @@ -67,9 +68,10 @@ def setup_file(self):
self.logger.addHandler(file_handler)


def setup_logger(name="connect", path=None, record_stream=False, logging_level="INFO"):
def setup_logger(name="connect", record_stream=False, logging_level="INFO"):
path = getenv("CREDO_CONNECT_LOG_PATH")
tmp = Logger(name, path, record_stream, logging_level)
return tmp.logger, tmp.stream


global_logger, global_tail = setup_logger(path=".")
global_logger, global_tail = setup_logger()

0 comments on commit 4be9720

Please sign in to comment.