Skip to content

Commit

Permalink
chore(logger): types definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Sep 28, 2021
1 parent dafd1d5 commit d752ef4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/types/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export interface LoggerState {
}

export interface LoggerContent {
type: 'system' | 'internal'
method: 'log' | 'warn' | 'error' | 'info'
arguments: IArguments
arguments: IArguments | string
createdAt: string
}
4 changes: 4 additions & 0 deletions src/use/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const global: Callback<Store<any>, void> = (store: Store<any>) => {

console.log = function () {
store.commit('logger/add', {
type: 'system',
method: 'log',
arguments,
createdAt: useFormat().actually(),
Expand All @@ -21,6 +22,7 @@ const global: Callback<Store<any>, void> = (store: Store<any>) => {

console.warn = function () {
store.commit('logger/add', {
type: 'system',
method: 'warn',
arguments,
createdAt: useFormat().actually(),
Expand All @@ -30,6 +32,7 @@ const global: Callback<Store<any>, void> = (store: Store<any>) => {

console.error = function () {
store.commit('logger/add', {
type: 'system',
method: 'error',
arguments,
createdAt: useFormat().actually(),
Expand All @@ -39,6 +42,7 @@ const global: Callback<Store<any>, void> = (store: Store<any>) => {

console.info = function () {
store.commit('logger/add', {
type: 'system',
method: 'info',
arguments,
createdAt: useFormat().actually(),
Expand Down

0 comments on commit d752ef4

Please sign in to comment.