Skip to content

Commit

Permalink
Issue #63: improve stringify.
Browse files Browse the repository at this point in the history
  • Loading branch information
fgm committed May 24, 2019
1 parent b45ef9c commit 5082607
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 74 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ the default Meteor port (3000). To use another port, be sure to change it in

```bash
cd (filog_dir)
meteor npm run compile
meteor npm run test
meteor npm run cover
meteor yarn run compile
meteor yarn run test
meteor yarn run cover
```

**TIP** Reading the `.travis.yml` file can be useful too.
3 changes: 2 additions & 1 deletion __tests__/unit/stringifyTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ function testStringifyMessage() {
[{ message: "foo" }, "foo"],
[{ message: 25 }, "25"],
[{ message: "foo", a: "A" }, 'foo'],
// Do not specialize other keys.
// Do not specialize other keys (notice the "s").
[{ messages: "foo", a: "A" }, "{ messages: 'foo', a: 'A' }"],
// Apply toString().
[o, JSON.stringify(value)],
[{ message: o }, JSON.stringify(value)],
[{ message: { toString: () => "Hello" } }, "Hello"],
// Default formatting.
Expand Down
14 changes: 7 additions & 7 deletions lib/Loggers/Logger.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ declare class Logger implements ILogger {
/**
* Map a syslog level to its standard name.
*
* @param {Number} level
* @param level
* An RFC5424 level.
*
* @returns {String}
* @returns
* The english name for the level.
*/
static levelName(level: number): string;
Expand Down Expand Up @@ -68,7 +68,7 @@ declare class Logger implements ILogger {
*
* @see Logger.log()
*
* @param {Number} requestedLevel
* @param requestedLevel
* A RFC5424 level.
*
* @throws InvalidArgumentException
Expand All @@ -81,15 +81,15 @@ declare class Logger implements ILogger {
/**
* @constructor
*
* @param {StrategyBase} strategy
* @param strategy
* The sender selection strategy to apply.
*
*/
constructor(strategy: IStrategy);
/**
* Arm the report subscriber.
*
* @returns {void}
* @returns
*
* @see Logger#reportSubscriber
*/
Expand All @@ -114,7 +114,7 @@ declare class Logger implements ILogger {
* In most cases, we do not want to disarm immediately: a stack trace being
* built may take several hundred milliseconds, and we would lose it.
*
* @param {Number} delay
* @param delay
* The delay before actually disarming, in milliseconds.
*
* @returns {void}
Expand Down Expand Up @@ -196,7 +196,7 @@ declare class Logger implements ILogger {
* A message context, possibly including a message_details key to separate
* data passed to the log() call from data added by processors.
*
* @returns {void}
* @returns
*/
send(strategy: IStrategy, level: LogLevel.Levels, message: string, sentContext: {}): void;
/**
Expand Down
52 changes: 35 additions & 17 deletions lib/Loggers/Logger.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Loggers/Logger.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Loggers/ServerLogger.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5082607

Please sign in to comment.