Skip to content

Commit c80ad90

Browse files
emmanuel-ferdmanpsychedelicious
authored andcommitted
Migrate to modern logger interface
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
1 parent 3b4d1b8 commit c80ad90

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

invokeai/app/api_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def overridden_redoc() -> HTMLResponse:
158158
try:
159159
app.mount("/", NoCacheStaticFiles(directory=Path(web_root_path, "dist"), html=True), name="ui")
160160
except RuntimeError:
161-
logger.warn(f"No UI found at {web_root_path}/dist, skipping UI mount")
161+
logger.warning(f"No UI found at {web_root_path}/dist, skipping UI mount")
162162
app.mount(
163163
"/static", NoCacheStaticFiles(directory=Path(web_root_path, "static/")), name="static"
164164
) # docs favicon is in here

invokeai/app/invocations/baseinvocation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def validate_fields(model_fields: dict[str, FieldInfo], model_type: str) -> None
499499

500500
ui_type = field.json_schema_extra.get("ui_type", None)
501501
if isinstance(ui_type, str) and ui_type.startswith("DEPRECATED_"):
502-
logger.warn(f'"UIType.{ui_type.split("_")[-1]}" is deprecated, ignoring')
502+
logger.warning(f'"UIType.{ui_type.split("_")[-1]}" is deprecated, ignoring')
503503
field.json_schema_extra.pop("ui_type")
504504
return None
505505

@@ -613,7 +613,7 @@ def wrapper(cls: Type[TBaseInvocation]) -> Type[TBaseInvocation]:
613613
raise InvalidVersionError(f'Invalid version string for node "{invocation_type}": "{version}"') from e
614614
uiconfig["version"] = version
615615
else:
616-
logger.warn(f'No version specified for node "{invocation_type}", using "1.0.0"')
616+
logger.warning(f'No version specified for node "{invocation_type}", using "1.0.0"')
617617
uiconfig["version"] = "1.0.0"
618618

619619
cls.UIConfig = UIConfigBase(**uiconfig)

invokeai/app/invocations/fields.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ class WithWorkflow:
437437
workflow = None
438438

439439
def __init_subclass__(cls) -> None:
440-
logger.warn(
440+
logger.warning(
441441
f"{cls.__module__.split('.')[0]}.{cls.__name__}: WithWorkflow is deprecated. Use `context.workflow` to access the workflow."
442442
)
443443
super().__init_subclass__()
@@ -578,7 +578,7 @@ def InputField(
578578

579579
if default_factory is not _Unset and default_factory is not None:
580580
default = default_factory()
581-
logger.warn('"default_factory" is not supported, calling it now to set "default"')
581+
logger.warning('"default_factory" is not supported, calling it now to set "default"')
582582

583583
# These are the args we may wish pass to the pydantic `Field()` function
584584
field_args = {

invokeai/app/services/images/images_default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def create(
7878
board_id=board_id, image_name=image_name
7979
)
8080
except Exception as e:
81-
self.__invoker.services.logger.warn(f"Failed to add image to board {board_id}: {str(e)}")
81+
self.__invoker.services.logger.warning(f"Failed to add image to board {board_id}: {str(e)}")
8282
self.__invoker.services.image_files.save(
8383
image_name=image_name, image=image, metadata=metadata, workflow=workflow, graph=graph
8484
)

invokeai/app/services/model_install/model_install_default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def stop(self, invoker: Optional[Invoker] = None) -> None:
148148
def _clear_pending_jobs(self) -> None:
149149
for job in self.list_jobs():
150150
if not job.in_terminal_state:
151-
self._logger.warning("Cancelling job {job.id}")
151+
self._logger.warning(f"Cancelling job {job.id}")
152152
self.cancel_job(job)
153153
while True:
154154
try:

0 commit comments

Comments
 (0)