-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from robert-northmind/develop
Adds DataCollector policy to be able to disable the collection of Rum data
- Loading branch information
Showing
5 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'dart:developer'; | ||
|
||
class DataCollectionPolicy { | ||
static final DataCollectionPolicy _instance = DataCollectionPolicy._(); | ||
|
||
DataCollectionPolicy._(); | ||
|
||
factory DataCollectionPolicy() { | ||
return _instance; | ||
} | ||
|
||
bool _isEnabled = true; | ||
bool get isEnabled => _isEnabled; | ||
|
||
void enable() { | ||
log('Enabling data collection'); | ||
_isEnabled = true; | ||
} | ||
|
||
void disable() { | ||
log('Disabling data collection'); | ||
_isEnabled = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters