perf: cache whether or not ELECTRON_DEBUG_NOTIFICATIONS env var is set (#45161)
* 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
dd85ddce20
commit
48aba26aac
7 changed files with 12 additions and 12 deletions
|
@ -44,7 +44,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] << ")";
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue