import * as logga from '@stencila/logga'; import schema from '@stencila/schema'; declare const log: logga.Logger; export default log; /** * Configure logger so that it: * * - only shows DEBUG entries if `debug=true` * - does not show the same message twice within 5s * * @param debug In debug mode? */ export declare const configure: (debug?: boolean, exitOnError?: boolean) => void; type CodecOperation = 'decode' | 'encode'; /** * Log a warning about the loss of data * * ```ts * logWarn('html', 'decode', `Unhandled element type ${elem.name}`) * ``` * * @param codec The codec emitting the warning * @param op The operation emitting the warning * @param message The message to emit */ export declare const logWarnLoss: (codec: string, op: CodecOperation, message: string) => void; /** * Log a warning if there is any loss of data * * Use this function to warn the user of any loss of * data during encoding or decoding e.g. * * ```ts * const {used, ...lost} = node * logWarnLossIfAny('html', 'encode', node, lost) * ``` * * @param codec The codec emitting the warning * @param op The operation emitting the warning * @param node The node from which data may be lost * @param lost An object with data that will be lost (if any) */ export declare const logWarnLossIfAny: (codec: string, op: CodecOperation, node: schema.Node, lost: object) => void; /** * Log an error regarding unhandled / unexpected node type * * @param codec The codec emitting the warning * @param op The operation emitting the warning * @param types The type/s expected * @param node The node from which data may be lost */ export declare const logErrorNodeType: (codec: string, op: CodecOperation, types: string, node: schema.Node) => void;