-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add graylog logging instantiation logic
- Loading branch information
Showing
2 changed files
with
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# @package engine.modules._name_ | ||
|
||
_target_: moai.engine.modules.HydraLogging | ||
# hyu: ${hydra:hydra_logging} | ||
job: ${hydra:job_logging} |
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,19 @@ | ||
# instantiate hydra logging for torchserve | ||
import omegaconf.omegaconf | ||
import typing | ||
import logging | ||
|
||
|
||
|
||
class HydraLogging(object): | ||
def __init__( | ||
self, | ||
# hyu: typing.Dict = None, | ||
job: omegaconf.DictConfig = None, | ||
): | ||
# NOTE: this is a workaround for the fact that torchserve | ||
# does not support hydra logging | ||
# | ||
print(f"Hydra logging: {job}") | ||
# Applying the logging configuration | ||
logging.config.dictConfig(omegaconf.OmegaConf.to_container(job, resolve=True)) |