-
Notifications
You must be signed in to change notification settings - Fork 45
Logger module in Efficient Transformers #517
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Hem Agnihotri <[email protected]>
Signed-off-by: Hem Agnihotri <[email protected]>
from QEfficient.utils.logging_utils import logger | ||
from QEfficient.utils.logging_utils import QEFFLogger | ||
|
||
logger = QEFFLogger.get_logger() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: where will this logs be dumped? in the default QEFF_HOME
path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently I am placing the logs at "~/.cache/.log, but we can think of a better place to keep all the logs. Only consideration we need to keep is we need to store init time logs also, so at init time many directories or sub-directories won't be available.
logger = QEFFLogger.get_logger() | ||
|
||
# Register the cleanup function | ||
atexit.register(QEFFLogger.close_logger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the naming as QEffLogger
, consistent with other library naming styles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes agree
|
||
def _initialize_logger(self) -> logging.Logger: | ||
# Define the hidden log directory path | ||
log_dir = os.path.expanduser("~/.cache/.log") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be QEFF_HOME
set by the user instead of default.
Default would be ~/.cache/qeff_models
, but can be overridden by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to see whether during init time directory qeff_models is created or not?
This change is not ready for review. Developement is still going on. Will post comment once its ready for review. |
This PR adds a logger module to the Efficient Transformer, enabling users to log messages at various levels such as INFO, DEBUG, WARNING, and ERROR.
It also provides the flexibility to configure the logging level based on the user's specific execution needs.