Comments (4)
I've submitted a pull request that fixes this issue in the plugin. But to address this in the flutter code I've created the following overriding class:
import 'package:logging/logging.dart';
import "package:datadog_flutter/datadog_flutter.dart";
class PDatadogFlutter extends DatadogFlutter {
PDatadogFlutter({
String clientToken,
String serviceName,
String loggerName,
bool bindOnRecord = true,
String environment = 'development',
}) : super(
clientToken: clientToken,
serviceName: serviceName,
loggerName: loggerName,
bindOnRecord: bindOnRecord,
environment: environment
);
@override
Future<void> log(String logMessage, Level logLevel,
{Map<String, dynamic> attributes}) async {
if (attributes == null) {
return super.log(logMessage, logLevel, attributes: {}); //providing an empty prevents the exception
}
return super.log(logMessage, logLevel, attributes: attributes);
}
}
You can then replace the DatadogLogger
type with this one to handle the case when attributes
argument is null
.
DatadogFlutter ddLogger = PDatadogFlutter(
clientToken: 's3cr37',
serviceName: 'myapp',
environment: 'development'
);
The "P" stands for "patched". Hope it helps someone!
from datadog_flutter.
@triztian reading your PR, the Flutter code should not be necessary to include, right?
from datadog_flutter.
@tshedor you are correct it is not needed, the flutter code is just my workaround until the PR was accepted or a different change addressed the issue. The code is a hack around it without having to change the plugin (kotlin/swift code) to build locally.
from datadog_flutter.
@triztian super. I'm going to close this issue then since #3 has been merged and released on pub dev. Thanks again for the contribution
from datadog_flutter.
Related Issues (20)
- Loading Type and Loading Time not show in RUM HOT 5
- Beta2 still doesn't compile on Flutter 3 HOT 3
- Deprecation of Community Plugin HOT 4
- App crashes on iOS HOT 2
- extrainfo is not displayed in session's attributes HOT 10
- MissingPluginException HOT 4
- Bug in Datadog Observer implementation HOT 3
- Status of 'Official' Datadog SDK Integration HOT 3
- Web Build Error 'TypeError: Cannot read properties of undefined (reading: 'init'), null, null) HOT 4
- Web Datadog Flutter error `Unsupported operation: Platform._operatingSystem` HOT 3
- `setUserInfo` `extraInfo` is not working on iOS. HOT 3
- Android API 31 Crash HOT 1
- Unable to determine Swift version for the following pods 'datadog_flutter' HOT 2
- datadog_flutter v1.7.0: App crashes when extraInfo property in setUserInfo method is null HOT 2
- Odd mappings of log levels happening on Android HOT 2
- Crash Reporting HOT 8
- Question: Why is tracing limited to http.Request HOT 8
- Disable [DEBUG] messages HOT 1
- Random failure when logging HOT 4
- pod 'DatadogSDKCrashReporting' is missing as of 1.7.3 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datadog_flutter.