-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Also pass file_path to the handler method #11
base: master
Are you sure you want to change the base?
Conversation
This is really a nice idea, thanks for that. I have a bit of a nitpick about the implementation. You've changed the arguments for |
@kvdveer No problem. I can make that change, but I really prefer to be explicit and use kwargs over a dict "with an arbitrary structure". With a dict approach, it's hard / impossible to do the introspection, and it's hard for user to know what to expect without checking the docs and / or code. Edit: I see the syslog issue - if I understand you correctly, syslog adds additional entries to the dict which contains the message? |
…itly specify a year.
Conflicts: logshipper/tail.py
Updated the code to use a dict, added tests cases (1bd1a63). Also cherry-picked fixes for test failures which are unrelated to my changes from my other pull request. |
The idea behind the dict is that is actually is a bunch of arbitrary I see your concern with unstructured data, but changing that would be On 03/23/2015 10:48 PM, Tomaz Muraus wrote:
|
@kvdveer Would it be possible to have a look at this again and merge it? Right now we are still using our fork of the library and would be great if we can get rid of that and just use the official version. |
With this change, we also pass file_path to the handler when a new line is detected.
This makes the whole thing more useful when monitoring / tailing multiple files. Previously it wasn't possible to know to which file the line refers to inside the handler function.
I also updated the handler method call to use keyword arguments instead of a dictionary. I know this is a breaking change, but it makes things more explicit and code more introspectable.
TODO: