* [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
33 lines
1.1 KiB
TypeScript
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),
|
|
};
|
|
}
|