mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 15:16:28 +08:00
init: the first public commit for AFFiNE
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { log } from './logger';
|
||||
|
||||
interface CreateNoopWithMessageProps {
|
||||
module?: string;
|
||||
message: string;
|
||||
level?: 'info' | 'warn' | 'error';
|
||||
}
|
||||
|
||||
export function createNoopWithMessage(
|
||||
props: CreateNoopWithMessageProps
|
||||
): (...p: any[]) => any {
|
||||
const { message, level = 'info', module } = props;
|
||||
const module_log = module ? log.get(module) : log;
|
||||
return () => {
|
||||
module_log[level](message);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user