kibana/x-pack/tasks/download_chromium.ts
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00

28 lines
980 B
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { LevelLogger } from '../plugins/reporting/server/lib';
import { ensureBrowserDownloaded } from '../plugins/reporting/server/browsers/download';
export const downloadChromium = async () => {
// eslint-disable-next-line no-console
const consoleLogger = (tag: string) => (message: unknown) => console.log(tag, message);
const innerLogger = {
get: () => innerLogger,
debug: consoleLogger('debug'),
info: consoleLogger('info'),
warn: consoleLogger('warn'),
trace: consoleLogger('trace'),
error: consoleLogger('error'),
fatal: consoleLogger('fatal'),
log: consoleLogger('log'),
};
const levelLogger = new LevelLogger(innerLogger);
await ensureBrowserDownloaded(levelLogger);
};