Skip to content

emit an event when a message is logged - #38490

Merged
icewind1991 merged 1 commit into
masterfrom
log-dispatch-event
Jun 14, 2023
Merged

emit an event when a message is logged#38490
icewind1991 merged 1 commit into
masterfrom
log-dispatch-event

Conversation

@icewind1991

@icewind1991icewind1991 commented May 26, 2023

Copy link
Copy Markdown
Member

Allow apps to do their own handling, notably this is emitted even if it would be normally filtered by log level

Needed for nextcloud/logreader#873

@icewind1991icewind1991 added the 3. to review Waiting for reviews label May 26, 2023
@icewind1991icewind1991 added this to the Nextcloud 28 milestone May 26, 2023
@icewind1991
icewind1991 requested review from a team, ArtificialOwl, blizzz and nfebe and removed request for a teamMay 26, 2023 17:05
@icewind1991
icewind1991 marked this pull request as ready for review May 26, 2023 17:06
@icewind1991
icewind1991force-pushed the log-dispatch-event branch 4 times, most recently from 3507df8 to 3d72315CompareJune 5, 2023 15:36
@icewind1991
icewind1991 requested a review from come-ncJune 9, 2023 17:38

@come-nccome-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance-wise, is that not too much overhead?

Comment threadlib/private/EventDispatcher/EventDispatcher.php
Comment threadlib/private/Files/Cache/Scanner.php Outdated
Comment threadlib/public/Log/BeforeMessageLoggedEvent.php Outdated
@icewind1991

Copy link
Copy Markdown
MemberAuthor

Performance-wise, is that not too much overhead?

From my understanding the event dispatcher is well optimized for the "no listeners" case.

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991
icewind1991 merged commit e6959bd into masterJun 14, 2023
@icewind1991
icewind1991 deleted the log-dispatch-event branch June 14, 2023 11:17
@icewind1991

Copy link
Copy Markdown
MemberAuthor

/backport to stable27

@icewind1991

Copy link
Copy Markdown
MemberAuthor

/backport to stable26

@ChristophWurstChristophWurst added enhancement pending documentation This pull request needs an associated documentation update labels Jun 15, 2023
@ChristophWurst

Copy link
Copy Markdown
Member

New API -> docs

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

Labels

3. to reviewWaiting for reviewsenhancementpending documentationThis pull request needs an associated documentation update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@icewind1991@ChristophWurst@nfebe@come-nc