Socket
Socket
Sign inDemoInstall

amqp-cacoon

Package Overview
Dependencies
42
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.0 to 3.2.0

build/types.d.ts

4

build/helpers/message_batching_manager.d.ts
import { ChannelWrapper, ConsumeMessage, ConsumeBatchMessages } from '../index';
import { Logger } from 'log4js';
import { ILogger } from '../types';
export interface IMessageBatchingManagerConfig {
providers: {
logger?: Logger;
logger?: ILogger;
};

@@ -7,0 +7,0 @@ maxSizeBytes?: number;

import { ChannelWrapper, AmqpConnectionManagerOptions } from 'amqp-connection-manager';
import { ConsumeMessage, Channel, ConfirmChannel, Options, Connection } from 'amqplib';
import { Logger } from 'log4js';
import { ILogger } from './types';
declare type ConnectCallback = (channel: ConfirmChannel) => Promise<any>;

@@ -36,3 +36,3 @@ declare type BrokerConnectCallback = (connection: Connection, url: string) => void;

providers: {
logger?: Logger;
logger?: ILogger;
};

@@ -39,0 +39,0 @@ onChannelConnect?: ConnectCallback;

{
"name": "amqp-cacoon",
"version": "3.1.0",
"version": "3.2.0",
"description": "AmqpCacoon is an abstraction around amqplib that provides a simple interface with flow control included out of the box",

@@ -21,4 +21,3 @@ "main": "build/index.js",

"amqplib": "^0.8.0",
"lodash": "^4.17.21",
"log4js": "^6.4.4"
"lodash": "^4.17.21"
},

@@ -25,0 +24,0 @@ "license": "MIT",

@@ -277,2 +277,28 @@ # AmqpCacoon

## Logger
You can pass a logger (optional) as the examples above. For a logger to work, it should have at least the following methods:
- debug
- error
- fatal
- info
- trace
Some loggers you may use:
- [log4js](https://www.npmjs.com/package/log4js)
- [tslog](https://www.npmjs.com/package/tslog)
- [bunyan](https://www.npmjs.com/package/bunyan)
The examples in the directory **./examples/src** use **log4js**.
And for a typescript project, using **tslog** is quite straightforward:
```typescript
const logger = new Logger({
displayLoggerName: true,
minLevel: 'silly',
name: 'amqp-cacoon logger',
type: 'pretty'
});
```
## Run the Examples

@@ -279,0 +305,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc