Skip to content

Commit

Permalink
Adding hint to the logger's error messages (#16034)
Browse files Browse the repository at this point in the history
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Fixes #15143

(cherry picked from commit 7ce3825)
  • Loading branch information
Al3xDo authored and Borda committed Dec 14, 2022
1 parent 7391839 commit f24d052
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ def check_logging(cls, fx_name: str) -> None:
)

if cls.functions[fx_name] is None:
raise MisconfigurationException(f"You can't `self.log()` inside `{fx_name}`.")
raise MisconfigurationException(
f"You can't `self.log()` inside `{fx_name}`. HINT: You can still log directly to the logger by using"
" `self.logger.experiment`."
)

@classmethod
def get_default_logging_levels(
Expand Down

0 comments on commit f24d052

Please sign in to comment.