title: How to mock Logger in jest
body: <p>How shall I jest mock the Logger method / instance? I did try online resources but could not find anything that works. Can someone please help me? Just mocking of logger method would be enough. I was able to mock other code. I can't test error condition because of that.</p>
  
  <pre><code>import rp from "request-promise-native";
  import BookLogger from "Book-logger";
  const logger = BookLogger.getLogger('Book-service', BookLogger.LOG_LEVEL.INFO);
  
  export class BookService {
  
  @param bookCategory id of book category
  @param boooks list of books
  
  public static async getAllBookInCategory(bookCategory: string) {
  
          try {
              const neededInfo = {
                  url: `https://${process.env.BOOK_HOST}/bookapi/${process.env.BOOKAPI_VERSION}/iterative/bookCategory/${ bookCategory }/books/all `,
                  method: 'GET',
              }
  
              const result = await BookService.makeRequest(bookCategory, neededInfo);
  
              return await rp(result);
          } catch(error) {
              logger.error(`Failed to get All Books in given category ${error}`)
          }
  }
  </code></pre>