Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aircall/logger

Package Overview
Dependencies
Maintainers
8
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aircall/logger - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [2.5.0](http://bitbucket.org/aircall/front-end-modules/compare/@aircall/logger@2.4.0...@aircall/logger@2.5.0) (2020-04-15)
### Features
* **logger:** add setContext method to Logger ([f263fe0](http://bitbucket.org/aircall/front-end-modules/commits/f263fe0ce20ef2b8b4e2045f89e4f805326bd167))
# [2.4.0](http://bitbucket.org/aircall/front-end-modules/compare/@aircall/logger@2.3.4...@aircall/logger@2.4.0) (2020-04-10)

@@ -8,0 +19,0 @@

1

dist/Logger.d.ts

@@ -35,2 +35,3 @@ import { StatusType } from '@datadog/browser-logs';

init({ level, context, token }: LoggerInitOptions): void;
setContext(context: UserContext): void;
private logOrEnqueue;

@@ -37,0 +38,0 @@ setLevel(level: StatusType): void;

@@ -32,3 +32,3 @@ "use strict";

});
browser_logs_1.datadogLogs.logger.setContext(context);
this.setContext(context);
browser_logs_1.datadogLogs.logger.setHandler(isDevelopment ? browser_logs_1.HandlerType.console : browser_logs_1.HandlerType.http);

@@ -39,2 +39,6 @@ this.setLevel(level);

}
// set logger context
setContext(context) {
browser_logs_1.datadogLogs.logger.setContext(context);
}
// Send logs or enqueue them if the SDK isn't initialized

@@ -41,0 +45,0 @@ logOrEnqueue(fn) {

4

package.json
{
"name": "@aircall/logger",
"version": "2.4.0",
"version": "2.5.0",
"main": "dist/index.js",

@@ -14,3 +14,3 @@ "types": "dist/index.d.ts",

},
"gitHead": "502f9740c2e8b1cc5f2b746bcf8524529605a83d",
"gitHead": "202b20d0d5963f933cef040ec5f58403aad5d719",
"dependencies": {

@@ -17,0 +17,0 @@ "@datadog/browser-logs": "1.7.3",

@@ -35,7 +35,9 @@ jest.mock('@datadog/browser-logs');

it('should set properties', (): void => {
jest.spyOn(logger, 'setContext');
const context = {
service: 'phone',
user_session
};
logger.init({
context: {
service: 'phone',
user_session
},
context,
token,

@@ -53,2 +55,4 @@ level: LOGGER_LEVEL.debug

});
expect(logger.setContext).toHaveBeenCalledWith(context);
expect(datadogLogs.logger.setContext).toHaveBeenCalledWith(context);
});

@@ -55,0 +59,0 @@ });

@@ -59,3 +59,3 @@ import { datadogLogs as sdk, StatusType, HandlerType } from '@datadog/browser-logs';

sdk.logger.setContext(context);
this.setContext(context);
sdk.logger.setHandler(isDevelopment ? HandlerType.console : HandlerType.http);

@@ -68,2 +68,7 @@

// set logger context
public setContext(context: UserContext) {
sdk.logger.setContext(context);
}
// Send logs or enqueue them if the SDK isn't initialized

@@ -70,0 +75,0 @@ private logOrEnqueue(fn: Function): void {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc