Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add support to push processor to the bottom of the stack#1976

Closed
vaishnavyogesh wants to merge 1 commit into
Seldaek:mainfrom
vaishnavyogesh:push-processor-to-bottom
Closed

feat: add support to push processor to the bottom of the stack#1976
vaishnavyogesh wants to merge 1 commit into
Seldaek:mainfrom
vaishnavyogesh:push-processor-to-bottom

Conversation

@vaishnavyogesh
Copy link
Copy Markdown

It was painful to add a processor to the bottom of the stack since we need to first pop all the processors then push it and popped processors back leading to O(N).

I believe it's just better to provide support for adding a processor to the bottom of the stack in just O(1).

Usecase: Let's say we have a processor which masks sensitive fields from the log record and it just makes sense to mask the details at the end after going through all previous processors, if we don't do it this way then the latter processors could add sensitive fields which won't be masked in that case.

Let me know any suggestions for improvements.

@Seldaek Also I believe we should dockerize the development environment, I'd like to work on the same too.

@Seldaek
Copy link
Copy Markdown
Owner

Seldaek commented Dec 30, 2025

IMO masking should happen in a formatter / formatter decorator, because processors can be added on the handlers themselves too, so doing it on Logger processors does not guarantee at all that you'll be called "last". Thus I disagree this needs to change sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants