How to use @algolia/logger-console - 2 common examples

To help you get started, we’ve selected a few @algolia/logger-console 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 / 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 / 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()],
    }),

@algolia/logger-console

Promise-based log library using console log.

MIT
Latest version published 1 day ago

Package Health Score

85 / 100
Full package analysis

Popular @algolia/logger-console functions

Similar packages