This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FRONTEND-3555 :: Feature :: Merge Logger & AbstractLogger and improve…
… API (#124) **Asana: https://app.asana.com/0/1109863238977521/1203172481263555/f** - Merge `Logger` interface and `AbstractLogger` into an abstract `Logger` - Make logging APIs compatible with `console.*` - Add `withTag()` factory method. This creates a new logger from a logger, but with a "tag" applied. Tags are strings that are preprended to log messages. - This can be a `string` or a `Type<T>`. [This is convenient (note that there aren't string quotes in `withTag()`)](https://github.com/mobilejazz/harmony-typescript/blob/de3b94b0a1cc4edd905b4b00cdf1744689b04a84/examples/angular/src/features/hacker-news-story/hacker-news-story.provider.ts#L93) as it allows to set a class as the tag and is refactor friendly (e.g. "rename symbol").
- Loading branch information
Showing
11 changed files
with
247 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...lar/src/features/hacker-news-story/domain/interactors/get-hacker-news-story.interactor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { GetInteractor } from '@mobilejazz/harmony-core'; | ||
import { GetInteractor, Logger } from '@mobilejazz/harmony-core'; | ||
|
||
import { GetHackerNewsStoryQuery } from '../../data/queries/hacker-news.query'; | ||
import { HackerNewsStory } from '../models/hacker-news-story.model'; | ||
|
||
export class GetHackerNewsStoryInteractor { | ||
constructor( | ||
private readonly getStory: GetInteractor<HackerNewsStory>, | ||
private readonly logger: Logger, | ||
) { } | ||
|
||
public async execute(id: number): Promise<HackerNewsStory> { | ||
this.logger.log('Getting story: %s', id); | ||
return this.getStory.execute(new GetHackerNewsStoryQuery(id)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.