-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
142d7e1
commit 4ad7a76
Showing
4 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
import logging | ||
|
||
from ai21.ai21_env_config import AI21EnvConfig | ||
|
||
logger = logging.getLogger("ai21") | ||
|
||
|
||
def _basic_config() -> None: | ||
logging.basicConfig( | ||
format="[%(asctime)s - %(name)s - %(levelname)s] %(message)s", | ||
datefmt="%Y-%m-%d %H:%M:%S", | ||
) | ||
|
||
|
||
def setup_logger() -> None: | ||
_basic_config() | ||
|
||
if AI21EnvConfig.log_level == "debug": | ||
logger.setLevel(logging.DEBUG) | ||
elif AI21EnvConfig.log_level == "info": | ||
logger.setLevel(logging.INFO) |