-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add support for gettid() to PatternEncoder #232
Conversation
Add {i} and {tid} to allow logging in particular the Linux thread ID as returned by gettid(). This is very useful for system-wide debugging und monitoring with consistent thread/task IDs. Fixes: #231
Two build errors. I'll take a look later.
|
The gettid crate seems to use the unstable compilation flag I found another crate which has a seemingly more complete impl. I also like that it leverages It's a little unclear what to do from here, maybe bug the palaver authors or steal their implementation and add a comment linking back to an issue requesting they stabilize their api, so when that happens we can just pull them in... |
I had some similar thoughts about gettid crate. I was thinking of asking the thread-id people if the would add gettid() to their crate. (I didn't know about palaver.) log4rs already depends on it and thread-id seems like a good place to add support. What do you think about this? |
@cloneable that sounds like a great plan. Lmk if there is anything I can do to help. |
So I looked at palaver and it seems like a well written library, but I agree that owners may have stopped caring. (The owner of the repo is still active elsewhere.) I like that they support more OSes (but not Redox), that they avoid phtread_self() and that their gettid() returns u64 whereas thread-id's get() returns usize for some weird reason. In summary none of gettid, thread-id and palaver is a great choice, but I still prefer palaver's provided implementations of gettid(). I'll ask them about state of maintainership and stability. |
nix is failing to build in 1.40 due to missing support for const_fn. I understand 1.40 is required for something, but are you planning to move to a younger release soon? If not then palaver is out. |
So, im open to changing the 1.40 requirement, but my feeling is that we should have at least a year of rust compiler backward compatibility. We could open a PR for palaver to gate the const fns on rust versions with dtolnay's: rustversion. @alecmocatta do you plan on cutting a non-alpha 0.3 soon? Are you looking for a maintainer for the palaver crate? |
@estk Thanks for the tag. I don't have the bandwidth at the moment but I'd happily add you as |
@alecmocatta that would be great, I'll work on a pr for |
@estk Thanks, look forward to reviewing! |
@alecmocatta & @cloneable it actually looks like the problem is in nix and it is only in one line of a macro there. I'm going to see if its just that and if they are open to PR's on the subject. I'll keep this thread up to date on how I go. |
Ok @alecmocatta & @cloneable I think the world has moved on. MSRV is |
Looks good now. Thank you both! |
Add {i} and {tid} to allow logging in particular the Linux
thread ID as returned by gettid(). This is very useful for
system-wide debugging und monitoring with consistent
thread/task IDs.
Fixes: #231