Skip to content

Commit

Permalink
feat: init options
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Aug 12, 2023
1 parent 3f224fa commit d152972
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/logger/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './logger';
26 changes: 26 additions & 0 deletions packages/logger/src/logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
type LogLevel = 'info' | 'warn' | 'error' | 'debug';

interface LogObject {
level?: LogLevel;
tag?: string;
date?: Date;
message?: string;
}

interface Reporter {
print: (log: LogObject) => void;
}

interface FormatOptions {}

interface LoggerOptions {
reporter: Reporter[];
level: LogLevel;
format: FormatOptions;
stdout: NodeJS.WriteStream;
stderr: NodeJS.WriteStream;
}

export function createLogger(options: Partial<LoggerOptions> = {}) {
return {};
}

0 comments on commit d152972

Please sign in to comment.