Skip to content

Commit

Permalink
fix(nightingale-react-native-console): always use console.log
Browse files Browse the repository at this point in the history
fixes #241
  • Loading branch information
christophehurpeau committed Nov 27, 2021
1 parent 00b1ec6 commit ad93004
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/nightingale-react-native-console/package.json
Expand Up @@ -84,7 +84,6 @@
},
"dependencies": {
"nightingale-ansi-formatter": "^11.7.2",
"nightingale-console-output": "^11.7.2",
"nightingale-types": "^11.7.2"
},
"devDependencies": {
Expand Down
11 changes: 9 additions & 2 deletions packages/nightingale-react-native-console/src/index.ts
@@ -1,5 +1,4 @@
import formatterANSI from 'nightingale-ansi-formatter';
import consoleOutput from 'nightingale-console-output';
import type {
Level,
Handle,
Expand All @@ -9,9 +8,17 @@ import type {
Handler,
} from 'nightingale-types';

function consoleOutput<T extends Metadata>(
param: string | string[],
record: LogRecord<T>,
): void {
// eslint-disable-next-line no-console
console.log(...param);
}

const createHandle = (): Handle => {
return <T extends Metadata>(record: LogRecord<T>): void => {
return consoleOutput([formatterANSI(record)], record);
consoleOutput([formatterANSI(record)], record);
};
};

Expand Down
1 change: 0 additions & 1 deletion yarn.lock
Expand Up @@ -8561,7 +8561,6 @@ __metadata:
"@babel/preset-env": 7.16.4
babel-preset-modern-browsers: 15.0.2
nightingale-ansi-formatter: ^11.7.2
nightingale-console-output: ^11.7.2
nightingale-types: ^11.7.2
pob-babel: 28.5.0
rollup: 2.60.1
Expand Down

0 comments on commit ad93004

Please sign in to comment.