How to use @algolia/logger-common - 5 common examples

To help you get started, we’ve selected a few @algolia/logger-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / algoliasearch-client-javascript / packages / logger-console / src / createConsoleLogger.ts View on Github external
debug(message: string, args?: any): Readonly> {
      if (LogLevelEnum.Debug >= logLevel) {
        console.debug(message, args);
      }

      return Promise.resolve();
    },
github algolia / algoliasearch-client-javascript / packages / logger-console / src / createConsoleLogger.ts View on Github external
info(message: string, args?: any): Readonly> {
      if (LogLevelEnum.Info >= logLevel) {
        console.info(message, args);
      }

      return Promise.resolve();
    },
github algolia / algoliasearch-client-javascript / packages / algoliasearch / src / builds / browser.ts View on Github external
export default function algoliasearch(
  appId: string,
  apiKey: string,
  options: AlgoliaSearchOptions = {}
): SearchClient {
  const logger = createConsoleLogger(options.logLevel || LogLevelEnum.Error);

  const clientOptions = {
    appId,
    apiKey,
    timeouts: {
      connect: 1,
      read: 2,
      write: 30,
    },
    requester: createBrowserXhrRequester(),
    logger,
    responsesCache: createInMemoryCache(),
    requestsCache: createInMemoryCache({ serializable: false }),
    hostsCache: createFallbackableCache({
      caches: [createBrowserLocalStorageCache({ version }), createInMemoryCache()],
    }),
github algolia / algoliasearch-client-javascript / packages / algoliasearch / src / builds / browserLite.ts View on Github external
export default function algoliasearch(
  appId: string,
  apiKey: string,
  options: AlgoliaSearchOptions = {}
): SearchClient {
  const logger = createConsoleLogger(options.logLevel || LogLevelEnum.Error);

  return createSearchClient({
    appId,
    apiKey,
    timeouts: {
      connect: 1,
      read: 2,
      write: 30,
    },
    requester: createBrowserXhrRequester(),
    logger,
    responsesCache: createInMemoryCache(),
    requestsCache: createInMemoryCache({ serializable: false }),
    hostsCache: createFallbackableCache({
      caches: [
        createBrowserLocalStorageCache({ key: `${version}-${appId}` }),
github algolia / algoliasearch-client-javascript / packages / algoliasearch / src / builds / node.ts View on Github external
export default function algoliasearch(appId: string, apiKey: string): SearchClient {
  const clientOptions = {
    appId,
    apiKey,
    timeouts: {
      connect: 2,
      read: 5,
      write: 30,
    },
    requester: createNodeHttpRequester(),
    logger: createNullLogger(),
    responsesCache: createNullCache(),
    requestsCache: createNullCache(),
    hostsCache: createInMemoryCache(),
    userAgent: createUserAgent(version).add({
      segment: 'Node.js',
      version: process.versions.node,
    }),
  };

  return createSearchClient({
    ...clientOptions,
    methods: {
      search: multipleQueries,
      searchForFacetValues: multipleSearchForFacetValues,
      multipleBatch,
      multipleGetObjects,

@algolia/logger-common

Common interfaces for promise-based log libraries

MIT
Latest version published 5 months ago

Package Health Score

80 / 100
Full package analysis

Similar packages