perf: cache whether or not ELECTRON_DEBUG_NOTIFICATIONS env var is set (#45162)
* perf: cache whether or not ELECTRON_DEBUG_NOTIFICATIONS env var is set Co-authored-by: Charles Kerr <charles@charleskerr.com> * chore: remove unused #include Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
b70d2944ff
commit
3a4edd7a2b
7 changed files with 12 additions and 12 deletions
|
@ -40,7 +40,7 @@ void CocoaNotification::Show(const NotificationOptions& options) {
|
|||
[notification_ setInformativeText:base::SysUTF16ToNSString(options.msg)];
|
||||
[notification_ setIdentifier:identifier];
|
||||
|
||||
if (getenv("ELECTRON_DEBUG_NOTIFICATIONS")) {
|
||||
if (electron::debug_notifications) {
|
||||
LOG(INFO) << "Notification created (" << [identifier UTF8String] << ")";
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ void CocoaNotification::NotificationDismissed() {
|
|||
}
|
||||
|
||||
void CocoaNotification::LogAction(const char* action) {
|
||||
if (getenv("ELECTRON_DEBUG_NOTIFICATIONS") && notification_) {
|
||||
if (electron::debug_notifications && notification_) {
|
||||
NSString* identifier = [notification_ valueForKey:@"identifier"];
|
||||
DCHECK(identifier);
|
||||
LOG(INFO) << "Notification " << action << " (" << [identifier UTF8String]
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
didActivateNotification:(NSUserNotification*)notif {
|
||||
auto* notification = presenter_->GetNotification(notif);
|
||||
|
||||
if (getenv("ELECTRON_DEBUG_NOTIFICATIONS")) {
|
||||
if (electron::debug_notifications) {
|
||||
LOG(INFO) << "Notification activated (" << [notif.identifier UTF8String]
|
||||
<< ")";
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ CocoaNotification* NotificationPresenterMac::GetNotification(
|
|||
return native_notification;
|
||||
}
|
||||
|
||||
if (getenv("ELECTRON_DEBUG_NOTIFICATIONS")) {
|
||||
if (electron::debug_notifications) {
|
||||
LOG(INFO) << "Could not find notification for "
|
||||
<< [ns_notification.identifier UTF8String];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue