-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from EURAC-EEBgroup/pre/beta
TTL to Description, Custom logger and Improvements
- Loading branch information
Showing
24 changed files
with
341 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
from .configs import GraphConfig | ||
from .schemas import ElemListSchema, RelationshipsSchema, TTLSchema | ||
from .logger import custom_logger | ||
from .schemas import ( | ||
ElemListSchema, | ||
RelationshipsSchema, | ||
TTLSchema, | ||
TTLToBuildingPromptSchema, | ||
) | ||
from .states import State, StateLocal | ||
|
||
__all__ = [ | ||
"ElemListSchema", | ||
"RelationshipsSchema", | ||
"TTLSchema", | ||
"TTLToBuildingPromptSchema", | ||
"State", | ||
"StateLocal", | ||
"GraphConfig", | ||
"custom_logger", | ||
] |
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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import logging | ||
|
||
# Create custom log level | ||
EURAC_LEVEL = 25 | ||
logging.addLevelName(EURAC_LEVEL, "EURAC") | ||
|
||
|
||
def eurac(self, message, *args, **kwargs): | ||
""" | ||
Log with custom EURAC level | ||
""" | ||
if self.isEnabledFor(EURAC_LEVEL): | ||
self._log(EURAC_LEVEL, message, args, **kwargs) | ||
|
||
|
||
# Add eurac method to Logger class | ||
logging.Logger.eurac = eurac | ||
|
||
|
||
# Create and configure logger | ||
def get_logger(name="BrickLLM"): | ||
logger = logging.getLogger(name) | ||
|
||
# Create handler if none exists | ||
if not logger.handlers: | ||
handler = logging.StreamHandler() | ||
formatter = logging.Formatter( | ||
"%(asctime)s - %(name)s - %(levelname)s - %(message)s" | ||
) | ||
handler.setFormatter(formatter) | ||
logger.addHandler(handler) | ||
|
||
logger.setLevel(EURAC_LEVEL) | ||
return logger | ||
|
||
|
||
# Create default logger instance | ||
custom_logger = get_logger() |
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
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
Oops, something went wrong.