Thread
#prefect-community
    John Shearer

    John Shearer

    10 months ago
    I'm running Prefect from tests - which works great. Currently Failed tasks log that failure at Info level, I wonder if Warning or Error might be more appropriate? It would certainly make it more obvious to me in logs/output here's an example
    Anna Geller

    Anna Geller

    10 months ago
    So the line you are referring to is only informing that a signal has been raised, which seems to be a valid INFO log message. But you can raise on exception if you want:
    # PrefectStateSignals are trapped and turned into States
            except signals.PrefectStateSignal as exc:
                <http://self.logger.info|self.logger.info>(
                    "{name} signal raised: {rep}".format(
                        name=type(exc).__name__, rep=repr(exc)
                    )
                )
                if raise_on_exception:
                    raise exc
                new_state = exc.state
    In general, Prefect handles the state transition for you, so you shouldn’t have to worry about it.
    John Shearer

    John Shearer

    10 months ago
    Thanks Anna.
    only informing that a signal has been raised, which seems to be a valid INFO log message
    yes, definitely valid. I'm just thinking it might be useful to log it as a warning, for increased visibility in logs (especially when not running through a prefect server (locally or on CI). (I can catch the exception during dev and the behaviour is of the program is correct, this is only about making this more visible in log out) Does that make sense?
    Anna Geller

    Anna Geller

    10 months ago
    sure. let me open an issue for it. @Marvin open “Change the log level to Warning when raising signal from the Runner”
    @John Shearer the issue has been closed since generally we warn when something is not working as intended and it’s not the case here.
    John Shearer

    John Shearer

    10 months ago
    Thanks @Anna Geller. Sure, that's fine. I appreciate you raising the discussion.