Instantly share code, notes, and snippets.

Embed
What would you like to do?
hello world AOP example with logging
class BookCollection {
...
return this.get({
isbn: isbn
}).then(book => {
Logger.info(`Retrieving book ${isbn} - ${book.name} has been succeed`);
return book.name;
}).catch(error => {
Logger.error(`Retrieving book ${isbn} has been failed. ${JSON.stringify(error)}`);
return null;
});
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment