Skip to content
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 a function to disable all logging at runtime #528

Merged
merged 5 commits into from
Aug 22, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Flip the scrip
  • Loading branch information
Adlai Holler committed Aug 22, 2017
commit 9fe9e337ed813b20f0f37b1862b233075d9c3cec
4 changes: 2 additions & 2 deletions Source/Base/ASLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
#import <AsyncDisplayKit/ASLog.h>
#import <stdatomic.h>

static atomic_bool __ASLogEnabled = ATOMIC_VAR_INIT(NO);
static atomic_bool __ASLogEnabled = ATOMIC_VAR_INIT(YES);

void ASDisableLogging() {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
atomic_store(&__ASLogEnabled, YES);
atomic_store(&__ASLogEnabled, NO);
});
}

Expand Down