Universal Logging for Typescript/JavaScript
Getting Started
Reference Manual
Plugins
FAQ's
v1.x
GitHub
Getting Started
Reference Manual
Plugins
FAQ's
v1.x
GitHub
  • Reference Manual
    • Introduction & Lifecycle
    • Log Class
    • Data Getters
    • Modifiers
    • Terminators
    • Global Store
    • Tools
    • Configuration
    • Middleware
    • Formatters
    • Unit Testing

Tools

The tools are a collection of methods that allow you to recall cached logs from a console, such as the browser dev tools console. This can be useful if you want to clear the logs and then reprint specific logs to narrow them down.

For a detailed tutorial on how to use them, refer to the Tools page of the Getting Started guide.

Public Methods

These are used for retrieving data and accessing the browser console tools.

filterByLabel


Rerenders all logs that match the provided label name.

Interface

class Tools {
  public filterByLabel(label: string): void;
}

Example

import adze, { setup } from 'adze';

const store = setup({
  cache: true,
});

adze.label('foo').log('This is a log that will rerender.');
adze.label('bar').log("This is another log that won't rerender.");

// Get the log cache.
store.tools.filterByLabel('foo');

Browser Output

filterByLabel tool method example browser output

Server Output

filterByLabel tool method example server output

filterByNamespace


Rerenders all logs that match the provided namespaces.

Interface

class Tools {
  public filterByNamespace(...namespace: string[]): void;
}

Example

import adze, { setup } from 'adze';

const store = setup({
  cache: true,
});

adze.ns('foo', 'bar').log('This is a log that will rerender.');
adze.ns('bar').log("This is another log that won't rerender.");

// Get the log cache.
store.tools.filterByNamespace('foo');

Browser Output

filterByNamespace tool method example browser output

Server Output

filterByNamespace tool method example server output

filterByLevel


Rerenders all logs that match the provided level selector.

Interface

class Tools {
  public filterByLevel(level: LevelSelector): void;
}

Example

import adze, { setup } from 'adze';

const store = setup({
  cache: true,
});

adze.info('This is a log that will rerender.');
adze.log("This is another log that won't rerender.");

// Get the log cache.
store.tools.filterByLevel('info');

Browser Output

filterByLevel tool method example browser output

Server Output

filterByLevel tool method example server output

renderAll


Rerenders all cached logs.

Interface

class Tools {
  public renderAll(): void;
}

Example

import adze, { setup } from 'adze';

const store = setup({
  cache: true,
});

adze.info('This is a log that will rerender.');
adze.log('This is another log that will rerender.');

// Get the log cache.
store.tools.renderAll();

Browser Output

renderAll tool method example browser output

Server Output

renderAll tool method example server output

Edit this page
Last Updated:
Contributors: Andrew Stacy
Prev
Global Store
Next
Configuration