infront-logger 1.1.15 → 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4127,6 +4127,14 @@ const DEFAULTS = {
4127
4127
  forwardErrorsToLogs: false,
4128
4128
  sessionSampleRate: 100
4129
4129
  };
4130
+ const connection = () => {
4131
+ var _a2, _b, _c, _d, _e, _f;
4132
+ return {
4133
+ downlink: (_b = (_a2 = window == null ? void 0 : window.navigator) == null ? void 0 : _a2.connection) == null ? void 0 : _b.downlink,
4134
+ effectiveType: (_d = (_c = window == null ? void 0 : window.navigator) == null ? void 0 : _c.connection) == null ? void 0 : _d.effectiveType,
4135
+ rtt: (_f = (_e = window == null ? void 0 : window.navigator) == null ? void 0 : _e.connection) == null ? void 0 : _f.rtt
4136
+ };
4137
+ };
4130
4138
  class DatadogLogger {
4131
4139
  constructor(options = {}) {
4132
4140
  if (!options.clientToken) {
@@ -4153,15 +4161,15 @@ class DatadogLogger {
4153
4161
  }
4154
4162
  log() {
4155
4163
  let normalized = normalizeArgs(...arguments);
4156
- this.logger.log(normalized.message, Object.assign(normalized.properties, this.ctx));
4164
+ this.logger.log(normalized.message, Object.assign(normalized.properties, { connection: connection() }, this.ctx));
4157
4165
  }
4158
4166
  info() {
4159
4167
  let normalized = normalizeArgs(...arguments);
4160
- this.logger.info(normalized.message, Object.assign(normalized.properties, this.ctx));
4168
+ this.logger.info(normalized.message, Object.assign(normalized.properties, { connection: connection() }, this.ctx));
4161
4169
  }
4162
4170
  error() {
4163
4171
  let normalized = normalizeArgs(...arguments);
4164
- this.logger.error(normalized.message, Object.assign(normalized.properties, this.ctx), normalized.error);
4172
+ this.logger.error(normalized.message, Object.assign(normalized.properties, { connection: connection() }, this.ctx), normalized.error);
4165
4173
  }
4166
4174
  context(key, value) {
4167
4175
  if (typeof key === "string") {
@@ -4131,6 +4131,14 @@
4131
4131
  forwardErrorsToLogs: false,
4132
4132
  sessionSampleRate: 100
4133
4133
  };
4134
+ const connection = () => {
4135
+ var _a2, _b, _c, _d, _e, _f;
4136
+ return {
4137
+ downlink: (_b = (_a2 = window == null ? void 0 : window.navigator) == null ? void 0 : _a2.connection) == null ? void 0 : _b.downlink,
4138
+ effectiveType: (_d = (_c = window == null ? void 0 : window.navigator) == null ? void 0 : _c.connection) == null ? void 0 : _d.effectiveType,
4139
+ rtt: (_f = (_e = window == null ? void 0 : window.navigator) == null ? void 0 : _e.connection) == null ? void 0 : _f.rtt
4140
+ };
4141
+ };
4134
4142
  class DatadogLogger {
4135
4143
  constructor(options = {}) {
4136
4144
  if (!options.clientToken) {
@@ -4157,15 +4165,15 @@
4157
4165
  }
4158
4166
  log() {
4159
4167
  let normalized = normalizeArgs(...arguments);
4160
- this.logger.log(normalized.message, Object.assign(normalized.properties, this.ctx));
4168
+ this.logger.log(normalized.message, Object.assign(normalized.properties, { connection: connection() }, this.ctx));
4161
4169
  }
4162
4170
  info() {
4163
4171
  let normalized = normalizeArgs(...arguments);
4164
- this.logger.info(normalized.message, Object.assign(normalized.properties, this.ctx));
4172
+ this.logger.info(normalized.message, Object.assign(normalized.properties, { connection: connection() }, this.ctx));
4165
4173
  }
4166
4174
  error() {
4167
4175
  let normalized = normalizeArgs(...arguments);
4168
- this.logger.error(normalized.message, Object.assign(normalized.properties, this.ctx), normalized.error);
4176
+ this.logger.error(normalized.message, Object.assign(normalized.properties, { connection: connection() }, this.ctx), normalized.error);
4169
4177
  }
4170
4178
  context(key, value) {
4171
4179
  if (typeof key === "string") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infront-logger",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist"