open-index/open-npm huggingface dataset:
npm package: @logium/dumbfound
Description: Utility for randomized testing
Latest version: 0.1.0-logium

# dumbfound

Randomized testing infrastructure. This is the main library that provides
support for reproducible randomness that is used to implement custom tests
for test runners such as [Jest][jest] and [Mocha][mocha].

## Introduction

Randomized testing is built around the idea that tests should sometimes fail,
and that every time a test fails it helps improve the quality of your project.
Randomized testing helps with failure by introducing limited randomness into
test cases to help find edge cases.

Dumbfound is built around supplying deterministic randomness that can be used
by a test case to generate random data. The deterministic aspect helps with
making test failures reproducible by providing a seed that can be used to
replay the test case.

## Using

For most use cases an implementation specific to a test runner should be used,
but this library can also be used directly:

```javascript
const { generateSeed, Randomizer } = require('dumbfound');

// Generate a seed for use with the randomizer
const seed = generateSeed();

// Create a new instance over the given seed
const random = new Randomizer(seed);

console.log('Using seed:', random.seed);
console.log('Generated int:', random.int(100));
```

## API documentation

For now see the [main repository][repo] for details about the API available
in tests.

[jest]: https://github.com/aholstenson/dumbfound/tree/master/packages/jest
[mocha]:https://github.com/aholstenson/dumbfound/tree/master/packages/mocha
[repo]: https://github.com/aholstenson/dumbfound/
npm package: @logivan/react-native-vibration
Description: Vibration module wrapping VibrationIOS and adding support for android
Author: Logivan SCI
Latest version: 1.0.0

# react-native-vibration

Vibration module with support for android, based on the pull request https://github.com/facebook/react-native/pull/2794 from @christopherdro. For iOS it wraps VibrationIOS. On iOS the duration can't be specified. If you don't specify a duration on Android 300ms will be used.

### Installation

```bash
npm i --save react-native-vibration
```

### Add it to your android project

* In `android/setting.gradle`

```gradle
...
include ':ReactNativeVibration', ':app'
project(':ReactNativeVibration').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vibration/android')
```

* In `android/app/build.gradle`

```gradle
...
dependencies {
    ...
    compile project(':ReactNativeVibration')
}
```

* register module (in MainActivity.java)

```java
import com.eguma.vibration.Vibration;  // <--- import

public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
  ......

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
      .setApplication(getApplication())
      .setBundleAssetName("index.android.bundle")
      .setJSMainModuleName("index.android")
      .addPackage(new MainReactPackage())
      .addPackage(new Vibration())              // <------ add here
      .setUseDeveloperSupport(BuildConfig.DEBUG)
      .setInitialLifecycleState(LifecycleState.RESUMED)
      .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "example", null);

    setContentView(mReactRootView);
  }

  ......

}
```

* allow vibration (in AndroidManifest.xml)
```xml
<uses-permission android:name="android.permission.VIBRATE" />
```

## Example
```javascript
'use strict';

var React = require('react-native');
var Vibration = require('react-native-vibration');

var {
  AppRegistry,
  StyleSheet,
  Text,
  TouchableHighlight,
  View,
} = React;

var VibrationExample = React.createClass({
  onPress() {
    Vibration.vibrate(500);
  },

  render() {
    return (
      <View style={styles.container}>
        <TouchableHighlight
          onPress={this.onPress}
          style={styles.button}
        >
          <Text>
            Click me to vibrate!
          </Text>
        </TouchableHighlight>
      </View>
    );
  }
});

var styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  button: {
    padding: 20,
    justifyContent: 'center',
    alignItems: 'center',
    borderColor: 'black',
    borderRadius: 5,
    borderWidth: 1,
  }
});

AppRegistry.registerComponent('VibrationExample', () => VibrationExample);
```
npm package: @logkat/logger
Description: @LogKat/Logger.js is a simple logging library which provides power to your normal `console.log`. It's easy to start and ever easier to customise.
Author: Abhishek Jain
Latest version: 0.0.4

# @LogKat/Logger.js - Simple JS Logger

@LogKat/Logger.js is a simple logging library which provides power to your normal `console.log`.
It's easy to start and ever easier to customise.

## Features

* Controlled logging to console
* Control Log Levels
* Easy customisation
* Log only when a specified log level filter is satisfied
* Can programmatically disable the logs

## Planned feature

* More Customization support
* Saving log file

## Setup

@logkat/logger.js is hosted at npm. The instructions are as follows -

    npm install @logkat/logger

## Usage

Following methods are available as per the log levels

    const logkat = require('@logkat/logger');
    logkat.verbose(message); //or logkat.v(message);
    logkat.log(message); //or logkat.debug(message); or or logkat.d(message);
    logkat.info(message); //or logkat.i(message);
    logkat.warn(message); //or logkat.w(message);
    logkat.error(message); //or logkat.e(message);

You can set Log Filtering by choosing the required Log Level -

    logkat.setLogLevel('info');

Or you can choose to disable all logging

    logkat.setLogLevel('prod');

You can break through the levels by always logging the text using the options parameter

    logkat.log('This will log, no matter what',{force:true});

You can also specify whether you want to stringify an object on logging.

    logkat.log(someObject,{stringify:true});


## Advanced Usage

If you're not happy with the default settings, you can change the settings, by calling `init(options)`

    logkat.init(options);

The default options are defined as

    const DEFAULT_OPTIONS = {
        logLevel: 'debug', //verbose,debug, info, error, prod
        error: {
            level: 'error',
            force: false,
            showStack: false,
            showDebug: true
        },
        colorTheme: {
            verbose: 'cyan',
            info: 'green',
            warn: 'yellow',
            debug: 'white',
            error: 'red'
        }
    };

You can provide partial options in init. For example to change the color theme for warnings to red, you just have to do -

    logkat.init({
        colorTheme:{
            warn: 'red'
        }
    });

## Contributions

Feel free to report bugs, feedback or even suggest new features. I'd love to make it a great library.

## Donate

[Paypal](https://paypal.me/Abhi347/5)
npm package: @logks/levels
Description: An enum of log levels as defined by RFC 3164.
Author: Brian Faust
Latest version: 0.1.0

# @logks/levels

> An enum of log levels as defined by RFC 3164.

[![Latest Version](https://badgen.now.sh/npm/v/@logks/levels)](https://www.npmjs.com/package/@logks/levels)
[![Node Engine](https://badgen.now.sh/npm/node/@logks/levels)](https://www.npmjs.com/package/@logks/levels)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn add @logks/levels
```

## Testing

```bash
yarn test
```

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

## Credits

-   [Brian Faust](https://github.com/faustbrian)
-   [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © [Brian Faust](https://basecode.sh)
npm package: @logks/logks
Description: A common interface for reusable Logger implementations in TypeScript.
Author: Brian Faust
Latest version: 0.1.0

# @logks/logks

> A common interface for reusable Logger implementations in TypeScript.

[![Latest Version](https://badgen.now.sh/npm/v/@logks/logks)](https://www.npmjs.com/package/@logks/logks)
[![Node Engine](https://badgen.now.sh/npm/node/@logks/logks)](https://www.npmjs.com/package/@logks/logks)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn add @logks/logks
```

## Testing

```bash
yarn test
```

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

## Credits

-   [Brian Faust](https://github.com/faustbrian)
-   [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © [Brian Faust](https://basecode.sh)
npm package: @loglayer/context-manager
Description: Base context manager used to implement context managers for loglayer.
Author: Theo Gravity
Latest version: 2.0.2

# @loglayer/context-manager

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fcontext-manager)](https://www.npmjs.com/package/@loglayer/context-manager)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fcontext-manager)](https://www.npmjs.com/package/@loglayer/context-manager)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

Provides Typescript types for [loglayer](https://loglayer.dev) context managers.

## Installation

```bash
npm i @loglayer/context-manager
```

## Documentation

Visit the [loglayer context manager docs](https://loglayer.dev/context-managers) on how to use and create context managers.
npm package: @loglayer/context-manager-isolated
Description: Context manager for loglayer that maintains isolated context for each logger instance.
Author: Theo Gravity
Latest version: 3.0.2

# Isolated Context Manager for LogLayer

[![npm version](https://badge.fury.io/js/@loglayer%2Fcontext-manager-isolated.svg)](https://badge.fury.io/js/@loglayer%2Fcontext-manager-isolated)
[![npm downloads](https://img.shields.io/npm/dm/@loglayer/context-manager-isolated.svg)](https://www.npmjs.com/package/@loglayer/context-manager-isolated)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A context manager for [LogLayer](https://loglayer.dev) that maintains isolated context for each logger instance. When a child logger is created, it starts with no context data - it does not inherit from the parent.

## Installation

```bash
npm install @loglayer/context-manager-isolated
```

```bash
yarn add @loglayer/context-manager-isolated
```

```bash
pnpm add @loglayer/context-manager-isolated
```

## Quick Start

```typescript
import { LogLayer } from "loglayer";
import { IsolatedContextManager } from "@loglayer/context-manager-isolated";

const log = new LogLayer({
  // ... other configuration
}).withContextManager(new IsolatedContextManager());

// Set context on parent logger
log.withContext({ userId: "123", requestId: "abc" });

// Create child logger - it will NOT inherit parent context
const childLog = log.child();

// Parent has context
console.log(log.getContext()); // { userId: "123", requestId: "abc" }

// Child starts with empty context
console.log(childLog.getContext()); // {}
```

For more advanced usage and configuration options, visit the [documentation](https://loglayer.dev/context-managers/isolated.html).
npm package: @loglayer/context-manager-linked
Description: Context manager for loglayer that keeps context between parent and all children.
Author: Theo Gravity
Latest version: 2.0.2

# Linked Context Manager for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fcontext-manager-linked)](https://www.npmjs.com/package/@loglayer/context-manager-linked)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fcontext-manager-linked)](https://www.npmjs.com/package/@loglayer/context-manager-linked)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A context manager for [LogLayer](https://loglayer.dev) that keeps context linked between parent and child loggers.

This means that changes to the context in the parent / child / child of child loggers will affect all loggers.

## Installation

```bash
npm install @loglayer/context-manager-linked
```

## Usage

```typescript
import { LogLayer, ConsoleTransport } from "loglayer";
import { LinkedContextManager } from '@loglayer/context-manager-linked';

const parentLog = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  }),
}).withContextManager(new LinkedContextManager());

const childLog = parentLog.child();

childLog.withContext({
  module: 'users'
});

parentLog.withContext({
  app: 'myapp'
});

parentLog.info('Parent log');
childLog.info('Child log');

// Output includes: { module: 'users', app: 'myapp' }
// for both parentLog and childLog
```

## Documentation

For more details, visit [https://loglayer.dev/context-managers/linked](https://loglayer.dev/context-managers/linked)
npm package: @loglayer/elysia
Description: ElysiaJS integration for LogLayer with request-scoped logging, auto request logging, and error handling.
Author: Theo Gravity
Latest version: 2.1.1

# ElysiaJS integration for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Felysia)](https://www.npmjs.com/package/@loglayer/elysia)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Felysia)](https://www.npmjs.com/package/@loglayer/elysia)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

An [ElysiaJS](https://elysiajs.com) plugin for [LogLayer](https://loglayer.dev) that provides request-scoped logging with automatic request/response logging and error handling.

## Installation

```bash
npm install @loglayer/elysia
```

## Usage

```typescript
import { Elysia } from "elysia";
import { LogLayer, StructuredTransport } from "loglayer";
import { elysiaLogLayer } from "@loglayer/elysia";

const log = new LogLayer({
  transport: new StructuredTransport({ logger: console }),
});

const app = new Elysia()
  .use(elysiaLogLayer({ instance: log }))
  .get("/", ({ log }) => {
    log.info("Hello!");
    return "Hello World!";
  })
  .listen(3000);
```

## Documentation

For more details, visit [https://loglayer.dev/integrations/elysia](https://loglayer.dev/integrations/elysia)
npm package: @loglayer/express
Description: Express integration for LogLayer with request-scoped logging, auto request logging, and error handling.
Author: Theo Gravity
Latest version: 1.0.0

# Express integration for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fexpress)](https://www.npmjs.com/package/@loglayer/express)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fexpress)](https://www.npmjs.com/package/@loglayer/express)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

An [Express](https://expressjs.com) middleware for [LogLayer](https://loglayer.dev) that provides request-scoped logging with automatic request/response logging and error handling.

## Installation

```bash
npm install @loglayer/express
```

## Usage

```typescript
import express from "express";
import { LogLayer, StructuredTransport } from "loglayer";
import { expressLogLayer, expressLogLayerErrorHandler } from "@loglayer/express";

const log = new LogLayer({
  transport: new StructuredTransport({ logger: console }),
});

const app = express();
app.use(expressLogLayer({ instance: log }));

app.get("/", (req, res) => {
  req.log.info("Hello!");
  res.send("Hello World!");
});

// Error handler (must be registered after routes)
app.use(expressLogLayerErrorHandler());

export default app;
```

## Documentation

For more details, visit [https://loglayer.dev/integrations/express](https://loglayer.dev/integrations/express)
npm package: @loglayer/fastify
Description: Fastify integration for LogLayer with request-scoped logging, auto request logging, and error handling.
Author: Theo Gravity
Latest version: 2.1.0

# Fastify integration for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Ffastify)](https://www.npmjs.com/package/@loglayer/fastify)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Ffastify)](https://www.npmjs.com/package/@loglayer/fastify)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A [Fastify](https://fastify.dev) plugin for [LogLayer](https://loglayer.dev) that provides request-scoped logging with automatic request/response logging and error handling.

## Installation

```bash
npm install @loglayer/fastify
```

## Usage

```typescript
import Fastify from "fastify";
import { LogLayer, StructuredTransport } from "loglayer";
import { fastifyLogLayer } from "@loglayer/fastify";

const log = new LogLayer({
  transport: new StructuredTransport({ logger: console }),
});

const app = Fastify();
await app.register(fastifyLogLayer, { instance: log });

app.get("/", (request, reply) => {
  request.log.info("Hello!");
  reply.send("Hello World!");
});

await app.listen({ port: 3000 });
```

## Documentation

For more details, visit [https://loglayer.dev/integrations/fastify](https://loglayer.dev/integrations/fastify)
npm package: @loglayer/hono
Description: Hono integration for LogLayer with request-scoped logging, auto request logging, and error handling.
Author: Theo Gravity
Latest version: 2.1.0

# Hono integration for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fhono)](https://www.npmjs.com/package/@loglayer/hono)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fhono)](https://www.npmjs.com/package/@loglayer/hono)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A [Hono](https://hono.dev) middleware for [LogLayer](https://loglayer.dev) that provides request-scoped logging with automatic request/response logging and error handling.

## Installation

```bash
npm install @loglayer/hono
```

## Usage

```typescript
import { Hono } from "hono";
import { LogLayer, StructuredTransport } from "loglayer";
import { honoLogLayer, type HonoLogLayerVariables } from "@loglayer/hono";

const log = new LogLayer({
  transport: new StructuredTransport({ logger: console }),
});

const app = new Hono<{ Variables: HonoLogLayerVariables }>();
app.use(honoLogLayer({ instance: log }));

app.get("/", (c) => {
  c.var.logger.info("Hello!");
  return c.text("Hello World!");
});

export default app;
```

## Documentation

For more details, visit [https://loglayer.dev/integrations/hono](https://loglayer.dev/integrations/hono)
npm package: @loglayer/koa
Description: Koa integration for LogLayer with request-scoped logging, auto request logging, and error handling.
Author: Theo Gravity
Latest version: 1.0.0

# Koa integration for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fkoa)](https://www.npmjs.com/package/@loglayer/koa)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fkoa)](https://www.npmjs.com/package/@loglayer/koa)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A [Koa](https://koajs.com) middleware for [LogLayer](https://loglayer.dev) that provides request-scoped logging with automatic request/response logging and error handling.

## Installation

```bash
npm install @loglayer/koa
```

## Usage

```typescript
import Koa from "koa";
import { LogLayer, StructuredTransport } from "loglayer";
import { koaLogLayer } from "@loglayer/koa";

const log = new LogLayer({
  transport: new StructuredTransport({ logger: console }),
});

const app = new Koa();
app.use(koaLogLayer({ instance: log }));

app.use((ctx) => {
  ctx.log.info("Hello!");
  ctx.body = "Hello World!";
});

app.listen(3000);
```

## Documentation

For more details, visit [https://loglayer.dev/integrations/koa](https://loglayer.dev/integrations/koa)
npm package: @loglayer/log-level-manager
Description: Base log level manager used to implement log level managers for loglayer.
Author: Theo Gravity
Latest version: 2.0.2

# @loglayer/log-level-manager

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Flog-level-manager)](https://www.npmjs.com/package/@loglayer/log-level-manager)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Flog-level-manager)](https://www.npmjs.com/package/@loglayer/log-level-manager)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

Provides TypeScript types and base implementation for [loglayer](https://loglayer.dev) log level managers.

## Installation

```bash
npm i @loglayer/log-level-manager
```

## Documentation

Visit the [loglayer log level manager docs](https://loglayer.dev/log-level-managers) on how to use and create log level managers.
npm package: @loglayer/log-level-manager-global
Description: Log level manager for loglayer that applies log level changes to all loggers globally.
Author: Theo Gravity
Latest version: 2.0.2

# Global Log Level Manager for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Flog-level-manager-global)](https://www.npmjs.com/package/@loglayer/log-level-manager-global)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Flog-level-manager-global)](https://www.npmjs.com/package/@loglayer/log-level-manager-global)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A log level manager for [LogLayer](https://loglayer.dev) that applies log level changes to all loggers globally, regardless of whether they are parent or child loggers.

## Installation

```bash
npm install @loglayer/log-level-manager-global
```

## Usage

```typescript
import { LogLayer, ConsoleTransport } from "loglayer";
import { GlobalLogLevelManager } from '@loglayer/log-level-manager-global';

const logger1 = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  }),
}).withLogLevelManager(new GlobalLogLevelManager());

const logger2 = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  }),
}).withLogLevelManager(new GlobalLogLevelManager());

// Changing log level on logger1 affects logger2 as well
logger1.setLevel(LogLevel.warn);

logger1.info('This will not be logged'); // Not logged
logger2.info('This will also not be logged'); // Not logged (affected by logger1's change)
```

## Documentation

For more details, visit [https://loglayer.dev/log-level-managers/global](https://loglayer.dev/log-level-managers/global)
npm package: @loglayer/log-level-manager-linked
Description: Log level manager for loglayer that keeps log levels synchronized between parent and children (parent and child changes affect each other bidirectionally).
Author: Theo Gravity
Latest version: 2.0.2

# Linked Log Level Manager for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Flog-level-manager-linked)](https://www.npmjs.com/package/@loglayer/log-level-manager-linked)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Flog-level-manager-linked)](https://www.npmjs.com/package/@loglayer/log-level-manager-linked)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A log level manager for [LogLayer](https://loglayer.dev) that keeps log levels synchronized between parent and children. Parent and child changes affect each other bidirectionally.

## Installation

```bash
npm install @loglayer/log-level-manager-linked
```

## Usage

```typescript
import { LogLayer, ConsoleTransport, LogLevel } from "loglayer";
import { LinkedLogLevelManager } from '@loglayer/log-level-manager-linked';

const parentLog = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  }),
}).withLogLevelManager(new LinkedLogLevelManager());

const childLog = parentLog.child();

// Parent changes affect children
parentLog.setLevel(LogLevel.warn);
childLog.info('This will not be logged'); // Not logged (affected by parent)

// Child changes also affect parent
childLog.setLevel(LogLevel.debug);
parentLog.debug('This will be logged'); // Logged (affected by child)
childLog.debug('This will be logged'); // Logged (child changed to debug)
```

## Documentation

For more details, visit [https://loglayer.dev/log-level-managers/linked](https://loglayer.dev/log-level-managers/linked)
npm package: @loglayer/log-level-manager-one-way
Description: Log level manager for loglayer that keeps log levels synchronized between parent and children (parent changes affect children, but child changes don't affect parents).
Author: Theo Gravity
Latest version: 2.0.2

# One Way Log Level Manager for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Flog-level-manager-one-way)](https://www.npmjs.com/package/@loglayer/log-level-manager-one-way)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Flog-level-manager-one-way)](https://www.npmjs.com/package/@loglayer/log-level-manager-one-way)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A log level manager for [LogLayer](https://loglayer.dev) that keeps log levels synchronized between parent and children. Parent changes affect children, but child changes do not affect parents.

## Installation

```bash
npm install @loglayer/log-level-manager-one-way
```

## Usage

```typescript
import { LogLayer, ConsoleTransport, LogLevel } from "loglayer";
import { OneWayLogLevelManager } from '@loglayer/log-level-manager-one-way';

const parentLog = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  }),
}).withLogLevelManager(new OneWayLogLevelManager());

const childLog = parentLog.child();

// Parent changes affect children
parentLog.setLevel(LogLevel.warn);
childLog.info('This will not be logged'); // Not logged (affected by parent)

// Child changes do not affect parent
childLog.setLevel(LogLevel.debug);
parentLog.debug('This will not be logged'); // Not logged (parent still at warn)
childLog.debug('This will be logged'); // Logged (child changed to debug)
```

## Documentation

For more details, visit [https://loglayer.dev/log-level-managers/one-way](https://loglayer.dev/log-level-managers/one-way)
npm package: @loglayer/mixin-datadog-http-metrics
Description: Adds Datadog HTTP metrics functionality to LogLayer using the datadog-metrics library.
Author: Theo Gravity
Latest version: 2.0.0

# Datadog Metrics (HTTP) mixin for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fmixin-datadog-http-metrics)](https://www.npmjs.com/package/@loglayer/mixin-datadog-http-metrics)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fmixin-datadog-http-metrics)](https://www.npmjs.com/package/@loglayer/mixin-datadog-http-metrics)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

Adds Datadog metrics functionality to the [LogLayer](https://loglayer.dev) logging library using [datadog-metrics](https://github.com/dbader/node-datadog-metrics).

The mixin provides a fluent builder API for sending metrics to Datadog via HTTP through a `ddStats` property on LogLayer instances. Unlike the [hot-shots mixin](https://www.npmjs.com/package/@loglayer/mixin-hot-shots) which sends metrics via StatsD/UDP, this mixin sends metrics directly to Datadog's HTTP API.

## Installation

```bash
npm install loglayer @loglayer/mixin-datadog-http-metrics
```

```bash
yarn add loglayer @loglayer/mixin-datadog-http-metrics
```

```bash
pnpm add loglayer @loglayer/mixin-datadog-http-metrics
```

## Usage

```typescript
import { LogLayer, useLogLayerMixin, ConsoleTransport } from 'loglayer';
import { datadogMetricsMixin } from '@loglayer/mixin-datadog-http-metrics';

// Register the mixin (must be called before creating LogLayer instances)
useLogLayerMixin(datadogMetricsMixin({
  apiKey: process.env.DATADOG_API_KEY,
  site: process.env.DATADOG_SITE, // e.g. 'us5.datadoghq.com'
  prefix: 'myapp.',
  defaultTags: ['env:production'],
}));

// Create LogLayer instance
const log = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  })
});

// Use Datadog metrics through the ddStats property
log.ddStats.increment('request.count').send();
log.ddStats.gauge('queue.size', 42).send();
log.ddStats.histogram('response.time', 250).send();
log.ddStats.distribution('latency', 100).send();

// Use builder pattern for advanced configuration
log.ddStats.increment('request.count')
  .withValue(5)
  .withTags(['env:production', 'service:api'])
  .withTimestamp(Date.now())
  .send();
```

## Documentation

For more details, visit [https://loglayer.dev/mixins/datadog-http-metrics](https://loglayer.dev/mixins/datadog-http-metrics).
npm package: @loglayer/mixin-hot-shots
Description: Adds statsd / hot-shots functionality to LogLayer.
Author: Theo Gravity
Latest version: 4.0.0

# hot-shots (StatsD) mixin for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fmixin-hot-shots)](https://www.npmjs.com/package/@loglayer/mixin-hot-shots)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fmixin-hot-shots)](https://www.npmjs.com/package/@loglayer/mixin-hot-shots)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

Adds StatsD metrics functionality to the [LogLayer](https://loglayer.dev) logging library using [hot-shots](https://github.com/bdeitte/hot-shots).

The mixin provides a fluent builder API for sending metrics to StatsD, DogStatsD, and Telegraf through a `stats` property on LogLayer instances. See the [hot-shots documentation](https://github.com/bdeitte/hot-shots) for detailed usage information about available methods and options.

## Installation

```bash
npm install loglayer @loglayer/mixin-hot-shots hot-shots
```

```bash
yarn add loglayer @loglayer/mixin-hot-shots hot-shots
```

```bash
pnpm add loglayer @loglayer/mixin-hot-shots hot-shots
```

## Usage

```typescript
import { LogLayer, useLogLayerMixin, ConsoleTransport } from 'loglayer';
import { StatsD } from 'hot-shots';
import { hotshotsMixin } from '@loglayer/mixin-hot-shots';

// Create a StatsD client
const statsd = new StatsD({
  host: 'localhost',
  port: 8125
});

// Register the mixin (must be called before creating LogLayer instances)
useLogLayerMixin(hotshotsMixin(statsd));

// Create LogLayer instance
const log = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  })
});

// Use StatsD methods through the stats property
log.stats.increment('request.count').send();
log.stats.decrement('request.count').send();
log.stats.timing('request.duration', 150).send();
log.stats.gauge('active.connections', 42).send();

// Use builder pattern for advanced configuration
log.stats.increment('request.count')
  .withValue(5)
  .withTags(['env:production', 'service:api'])
  .withSampleRate(0.5)
  .send();
```

## Documentation

For more details, visit [https://loglayer.dev/mixins/hot-shots](https://loglayer.dev/mixins/hot-shots).
npm package: @loglayer/plugin
Description: Base plugin used to implement plugins for loglayer.
Author: Theo Gravity
Latest version: 3.0.2

# @loglayer/plugin

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fplugin)](https://www.npmjs.com/package/@loglayer/plugin)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fplugin)](https://www.npmjs.com/package/@loglayer/plugin)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

Provides Typescript types for [loglayer](https://loglayer.dev) plugins.

## Installation

```bash
npm i @loglayer/plugin
```

## Documentation

Visit the [loglayer plugin docs](https://loglayer.dev/plugins) on how to use and create plugins.
npm package: @loglayer/plugin-datadog-apm-trace-injector
Description: Injects DataDog APM traces to logs in LogLayer.
Author: Theo Gravity
Latest version: 2.0.2

# Datadog APM Trace Injector Plugin for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fplugin-datadog-apm-trace-injector)](https://www.npmjs.com/package/@loglayer/plugin-datadog-apm-trace-injector)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fplugin-datadog-apm-trace-injector)](https://www.npmjs.com/package/@loglayer/plugin-datadog-apm-trace-injector)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A plugin for [LogLayer](https://loglayer.dev) that automatically injects Datadog APM trace context into your logs. This enables correlation between your application logs and distributed traces in Datadog.

## Installation

This plugin requires the [`dd-trace`](https://github.com/DataDog/dd-trace-js) library to be installed in your project:

```bash
npm install @loglayer/plugin-datadog-apm-trace-injector dd-trace
```

## Usage

```typescript
// dd-trace generally needs to be the first import of any project
// as it needs to patch node_module packages before they are imported
import tracer from 'dd-trace';
import { LogLayer } from 'loglayer';
import { datadogTraceInjectorPlugin } from '@loglayer/plugin-datadog-apm-trace-injector';

tracer.init();

// Create the plugin
const traceInjector = datadogTraceInjectorPlugin({
  tracerInstance: tracer,
  // Enable the plugin only if the Datadog API key is set
  disabled: !process.env.DD_API_KEY
});

// Add to your LogLayer instance
const log = new LogLayer({
  plugins: [traceInjector],
});

// Your logs will now automatically include trace context
log.info('User action completed');
```

### Configuration

The plugin accepts the following configuration options:

| Option | Type | Description |
|--------|------|-------------|
| `id` | `string` | Optional. Unique identifier for the plugin |
| `tracerInstance` | `Tracer` | Required. The dd-trace tracer instance |
| `disabled` | `boolean` | Optional. Disable the plugin |
| `onError` | `(error: Error, data?: Record<string, any>) => void` | Optional. Error handler for tracer operation failures |

## Documentation

For more details, visit [https://loglayer.dev/plugins/datadog-apm-trace-injector](https://loglayer.dev/plugins/datadog-apm-trace-injector)
npm package: @loglayer/plugin-filter
Description: Filter logs with LogLayer using string patterns, regular expressions, or JSON Queries.
Author: Theo Gravity
Latest version: 4.0.2

# Log filtering plugin for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fplugin-filter)](https://www.npmjs.com/package/@loglayer/plugin-filter)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fplugin-filter)](https://www.npmjs.com/package/@loglayer/plugin-filter)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A plugin for [LogLayer](https://loglayer.dev) that filters log messages. You can filter logs using string patterns, regular expressions, 
or [JSON Queries](https://jsonquerylang.org/).

## Installation

```bash
npm install @loglayer/plugin-filter
```

## Usage

```typescript
import { filterPlugin } from '@loglayer/plugin-filter';

// Create a filter that only allows error messages
const filter = filterPlugin({
  // checks the assembled message using an includes()
  messages: ['error'],
});

// Checks the level of the log
const levelFilter = filterPlugin({
  queries: ['.level == "error" or .level == "warn"'],
});
```

### Configuration

The plugin accepts the following configuration options:

| Option | Type | Description                                                                                                                       |
|--------|------|-----------------------------------------------------------------------------------------------------------------------------------|
| `messages` | `Array<string \| RegExp>` | Optional. Array of string patterns or regular expressions to match against log messages                                           |
| `queries` | `string[]` | Optional. Array of JSON queries to filter logs. A JSON Query `filter()` is applied, which each item being part of an OR condition |
| `debug` | `boolean` | Optional. Enable debug mode for troubleshooting                                                                                   |
| `disabled` | `boolean` | Optional. Disable the plugin                                                                                                      |

## Documentation

For more details, visit [https://loglayer.dev/plugins/filter](https://loglayer.dev/plugins/filter)
npm package: @loglayer/plugin-opentelemetry
Description: OpenTelemetry plugin for LogLayer that adds trace context to logs.
Author: Theo Gravity
Latest version: 3.0.2

# OpenTelemetry Plugin for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fplugin-opentelemetry)](https://www.npmjs.com/package/@loglayer/plugin-opentelemetry)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fplugin-opentelemetry)](https://www.npmjs.com/package/@loglayer/plugin-opentelemetry)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

The OpenTelemetry plugin for [LogLayer](https://loglayer.dev) uses the [`@opentelemetry/api`](https://www.npmjs.com/package/@opentelemetry/api)
to store the following in the log context:

- `trace_id`
- `span_id`
- `trace_flags`

This allows you to cross-reference your logs with generated traces.

### Note

If you are using OpenTelemetry with log processors, use the [OpenTelemetry Transport](https://loglayer.dev/transports/opentelemetry).
If you don't know what that is, then you'll want to use this plugin instead of the transport.

## Installation

```bash
npm install @loglayer/plugin-opentelemetry loglayer
```

## Usage

```typescript
import { LogLayer, ConsoleTransport } from 'loglayer'
import { openTelemetryPlugin } from '@loglayer/plugin-opentelemetry'

const log = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  }),
  plugins: [
    openTelemetryPlugin()
  ]
})

// Example usage
log.info("Hello world")
// Output: Hello world!

```

## Configuration

The plugin accepts the following configuration options:

```typescript
interface OpenTelemetryPluginParams {
  /**
   * If specified, all trace fields will be nested under this key
   */
  traceFieldName?: string;
  
  /**
   * Field name for the trace ID. Defaults to 'trace_id'
   */
  traceIdFieldName?: string;
  
  /**
   * Field name for the span ID. Defaults to 'span_id'
   */
  spanIdFieldName?: string;
  
  /**
   * Field name for the trace flags. Defaults to 'trace_flags'
   */
  traceFlagsFieldName?: string;
  
  /**
   * Unique identifier for the plugin
   */
  id?: string;
  
  /**
   * Whether the plugin is disabled
   */
  disabled?: boolean;
}
```

### Example with Custom Configuration

```typescript
const log = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  }),
  plugins: [
    openTelemetryPlugin({
      // Nest all trace fields under 'trace'
      traceFieldName: 'trace',
      // Custom field names
      traceIdFieldName: 'traceId',
      spanIdFieldName: 'spanId',
      traceFlagsFieldName: 'flags'
    })
  ]
})
```

This would output logs with the following structure:
```json
{
  "trace": {
    "traceId": "8de71fcab951aad172f1148c74d0877e",
    "spanId": "349623465c6dfc1b",
    "flags": "01"
  }
}
```

## Documentation

For more details, visit [https://loglayer.dev/plugins/opentelemetry](https://loglayer.dev/plugins/opentelemetry)
npm package: @loglayer/plugin-redaction
Description: Log redaction plugin for loglayer.
Author: Theo Gravity
Latest version: 3.0.2

# Redaction Plugin for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fplugin-redaction)](https://www.npmjs.com/package/@loglayer/plugin-redaction)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fplugin-redaction)](https://www.npmjs.com/package/@loglayer/plugin-redaction)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

The redaction plugin for [loglayer](https://loglayer.dev) provides data redaction support for LogLayer using [fast-redact](https://www.npmjs.com/package/fast-redact). 
It allows you to automatically redact sensitive information from your logs.

It currently only performs redaction on metadata.

## Installation

```bash
npm install @loglayer/plugin-redaction
```

## Usage

```typescript
import { LogLayer, ConsoleTransport } from 'loglayer'
import { redactionPlugin } from '@loglayer/plugin-redaction'

const log = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  }),
  plugins: [
    redactionPlugin({
      paths: ["password", "creditCard"],
      censor: "[REDACTED]"
    })
  ]
})

// Example usage
log.withMetadata({ 
  user: "john", 
  password: "secret123",
  creditCard: "1234-5678-9012-3456"
}).info("User logged in")
// Output will redact password and creditCard fields
```

## Configuration Options

The plugin accepts the following options:

```typescript
interface RedactionPluginOptions {
  /**
   * Unique identifier for the plugin. Used for selectively disabling / enabling
   * and removing the plugin.
   */
  id?: string;

  /**
   * If true, the plugin will skip execution
   */
  disabled?: boolean;

  /**
   * An array of strings describing the nested location of a key in an object.
   * See https://www.npmjs.com/package/fast-redact for path syntax.
   */
  paths?: string[];

  /**
   * This is the value which overwrites redacted properties.
   * Default: "[REDACTED]"
   */
  censor?: string | ((v: any) => any);

  /**
   * When set to true, will cause keys to be removed from the serialized output.
   * Default: false
   */
  remove?: boolean;

  /**
   * When set to true, will cause the redactor function to throw if instead of an object it finds a primitive.
   * Default: false
   */
  strict?: boolean;
}
```

## Documentation

For more details, visit [https://loglayer.dev/plugins/redaction](https://loglayer.dev/plugins/redaction)
npm package: @loglayer/plugin-sprintf
Description: sprintf plugin for loglayer.
Author: Theo Gravity
Latest version: 3.0.2

# Sprintf Plugin for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fplugin-sprintf)](https://www.npmjs.com/package/@loglayer/plugin-sprintf)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fplugin-sprintf)](https://www.npmjs.com/package/@loglayer/plugin-sprintf)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

The sprintf plugin for [loglayer](https://loglayer.dev) provides printf-style string formatting support using [sprintf-js](https://www.npmjs.com/package/sprintf-js). 

It allows you to format your log messages using familiar printf-style placeholders if a transport does not support this behavior.

## Disclaimer

- LogLayer does not allow passing items that are not strings, booleans, or numbers into message methods like `info`, `error`,
etc, and would recommend that only string / boolean / number specifiers be used.

## Installation

```bash
npm install @loglayer/plugin-sprintf
```

## Usage

```typescript
import { LogLayer, ConsoleTransport } from 'loglayer'
import { sprintfPlugin } from '@loglayer/plugin-sprintf'

const log = new LogLayer({
  transport: new ConsoleTransport({
    logger: console
  }),
  plugins: [
    sprintfPlugin()
  ]
})

// Example usage
log.info("Hello %s!", "world")
// Output: Hello world!

log.info("Number: %d", 42)
// Output: Number: 42
```

## Documentation

For more details, visit [https://loglayer.dev/plugins/sprintf](https://loglayer.dev/plugins/sprintf)
npm package: @loglayer/shared
Description: Shared utilities and types for loglayer packages.
Author: Theo Gravity
Latest version: 4.1.0

# loglayer-shared

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Fshared)](https://www.npmjs.com/package/@loglayer/shared)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Fshared)](https://www.npmjs.com/package/@loglayer/shared)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

Shared utilities and types for use with [loglayer](https://loglayer.dev).
npm package: @loglayer/transport
Description: Base transport used to implement logging transports for loglayer.
Author: Theo Gravity
Latest version: 3.0.2

# loglayer-transport

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Ftransport)](https://www.npmjs.com/package/@loglayer/transport)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Ftransport)](https://www.npmjs.com/package/@loglayer/transport)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

This is the base transport used for implementing transports for use with [loglayer](https://loglayer.dev).

## Installation

```bash
npm i @loglayer/transport
```

## Documentation

Visit the [loglayer transport docs](https://loglayer.dev/transports) on how to use and create transports.
npm package: @loglayer/transport-aws-cloudwatch-logs
Description: AWS CloudWatch Logs logger transport for the LogLayer logging library
Author: Quetzal Rivera
Latest version: 2.0.2

# AWS CloudWatch Logs Logger Transport for LogLayer

[![NPM Version](https://img.shields.io/npm/v/%40loglayer%2Ftransport-aws-cloudwatch-logs)](https://www.npmjs.com/package/@loglayer/transport-aws-cloudwatch-logs)
[![NPM Downloads](https://img.shields.io/npm/dm/%40loglayer%2Ftransport-aws-cloudwatch-logs)](https://www.npmjs.com/package/@loglayer/transport-aws-cloudwatch-logs)
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)

A transport for the [LogLayer](https://loglayer.dev) logging library using the [AWS CloudWatch Logs](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/).

## Installation

```bash
npm install loglayer @loglayer/transport-aws-cloudwatch-logs @aws-sdk/client-cloudwatch-logs serialize-error
```

## Usage

```typescript
import { LogLayer } from 'loglayer';
import { CloudWatchLogsTransport } from "@loglayer/transport-aws-cloudwatch-logs";
import { serializeError } from "serialize-error";

// Create LogLayer instance with CloudWatch Logs transport
const log = new LogLayer({
  errorSerializer: serializeError,
  transport: new CloudWatchLogsTransport({
    // Set the log group and stream name to use.
    groupName: "/loglayer/group",
    streamName: "loglayer-stream-name",
  }),
});

// Use LogLayer as normal
log.withMetadata({ customField: 'value' }).info('Hello from Lambda!');

// The transport formats messages as JSON with level, timestamp, data fields, and message
// Example output: {"level":"info","timestamp":1641013456789,"customField":"value","message":"Hello from Lambda!"}
```

## Documentation

For configuration options and examples, visit [https://loglayer.dev/transports/aws-cloudwatch-logs](https://loglayer.dev/transports/aws-cloudwatch-logs)