kibana/x-pack/plugins/ml/server/client/log.ts
James Gowdy d5c092811b
[ML] Adding shared services to ml setup contract (#59730)
* [ML] Adding shared services to ml setup contract

* adding data recognizer

* typescripting js client

* adding results service

* code clean up

* adding generic ml index search

* making cloud optional
2020-03-12 10:04:40 +00:00

33 lines
1.1 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { Logger } from 'kibana/server';
export interface LogInitialization {
log: Logger;
}
interface MlLog {
fatal: (message: string) => void;
error: (message: string) => void;
warn: (message: string) => void;
info: (message: string) => void;
debug: (message: string) => void;
trace: (message: string) => void;
}
export let mlLog: MlLog;
export function initMlServerLog(logInitialization: LogInitialization) {
mlLog = {
fatal: (message: string) => logInitialization.log.fatal(message),
error: (message: string) => logInitialization.log.error(message),
warn: (message: string) => logInitialization.log.warn(message),
info: (message: string) => logInitialization.log.info(message),
debug: (message: string) => logInitialization.log.debug(message),
trace: (message: string) => logInitialization.log.trace(message),
};
}