flâneur — a map of the web's best reading

Messages — Eliot 1.14.0+0.g3584072 documentation

eliot.readthedocs.io · 189 words · saved by 1 readers

Sometimes you don’t want to generate actions. sometimes you just want an individual isolated message, the way traditional logging systems work. Here’s how to do that. If you already have an action object, you can log a message in that action’s context: If you don’t have a reference to an action, or you’re worried the function will sometimes be called outside the context of any action at all, you can use log_message: The main downside to using this function is that it’s a little slower, since it needs to handle the case where there is no action in context. © Copyright 2014-2018, ClusterHQ and Itamar Turner-Trauring Revision 3584072c.

Messages - Eliot 1.14.0+0.g3584072 documentation --> Docs >> Generating Logs >> Messages Edit on GitHub Messages ¶ Sometimes you don’t want to generate actions. sometimes you just want an individual isolated message, the way traditional logging systems work. Here’s how to do that. When you have an action ¶ If you already have an action object, you can log a message in that action’s context: from eliot import start_action class YourClass ( object ): def run ( self ): with start_action ( action_type = "myaction" ) as ctx : ctx . log ( message_type = "mymessage" , key = "abc" , key2 = 4 ) If you

Explore this link on the map →

related reading