Skip to content

Commit

Permalink
feat(logger): logs Symbol(name) instead of Symbol to be more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdo29 committed Aug 10, 2020
1 parent f139182 commit 137db86
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
],
"scripts": {
"preversion": "yarn run format && yarn run lint && yarn build",
"version": "yarn build:tools && yarn updatePeerDeps",
"postversion": "yarn build:tools && yarn updatePeerDeps",
"bootstrap": "lerna bootstrap",
"build": "lerna run build --stream",
"build:tools": "tsc -p tools/tsconfig.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/logger/src/logger/ogma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class Ogma {
const seen = new WeakSet();
return (key: string, value: any): string => {
if (typeof value === 'symbol') {
return this.wrapInBrackets('Symbol');
return this.wrapInBrackets(value.toString());
}
if (typeof value === 'function') {
return this.wrapInBrackets('Function');
Expand Down
2 changes: 0 additions & 2 deletions packages/logger/test/command.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ const ogmaHydrateTest = async (
await expect(ogmaHydrate(hydrateArgs)).resolves.not.toThrow();
expect(readSpy).toBeCalledWith(someFile);
expect(writeSpy).toBeCalledTimes(1);
console.log(writeSpy.mock.calls[0][0].toString());
console.log(expectedVal);
expect(writeSpy).toBeCalledWith(Buffer.from(expectedVal));
readSpy.mockClear();
};
Expand Down
2 changes: 1 addition & 1 deletion packages/logger/test/ogma.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('Ogma Class', () => {
expect.stringContaining('[Function]'),
);
expect(mockStream.write.mock.calls[0][0]).toEqual(
expect.stringContaining('[Symbol]'),
expect.stringContaining('[Symbol(hello)]'),
);
});
it('should follow the context, application, and message of a json', () => {
Expand Down

0 comments on commit 137db86

Please sign in to comment.