How to use the @tsed/common.$log.error function in @tsed/common

To help you get started, we’ve selected a few @tsed/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TypedProject / ts-express-decorators / examples / passport-azure-ad / packages / server / src / protocols / BearerStrategy.ts View on Github external
try {
        const options = req.ctx.endpoint.get(OAuthBearerOptions) || {}; // retrieve options configured for the endpoint
        // check precondition and authenticate user by their token and given options
        try {
          const user = authService.verify(token, options);

          if (!user) {
            authService.add(token);
            $log.info({event: "BearerStrategy - token: ", token});
            return done(null, token);
          }

          $log.info({event: "BearerStrategy - user: ", token});
          return done(null, user, token);
        } catch (error) {
          $log.error({event: "BearerStrategy", token, error});
          return done(error);
        }
      } catch (error) {
        return done(error);
      }
    };
github TranBaVinhSon / microservice_nodejs_template / packages / api_gateway / src / index.ts View on Github external
async function bootstrap(): Promise<void> {
  try {
    $log.debug("Start server...");
    const server = await ServerLoader.bootstrap(Server);

    await server.listen();
    $log.debug("Server initialized");
    Logger(); // hello, world
  } catch (er) {
    $log.error(er);
  }
}
github TypedProject / ts-express-decorators / integration / session / src / index.ts View on Github external
async function bootstrap() {
  try {
    $log.debug("Start server...");
    const server = await ServerLoader.bootstrap(Server);

    await server.listen();
    $log.debug("Server initialized");
  } catch (er) {
    $log.error(er);
  }
}
github TypedProject / ts-express-decorators / integration / socketio / src / index.ts View on Github external
async function bootstrap() {
  try {
    $log.debug("Start server...");
    const server = await ServerLoader.bootstrap(Server);

    await server.listen();
    $log.debug("Server initialized");
  } catch (er) {
    $log.error(er);
  }
}
github TypedProject / ts-express-decorators / integration / typeorm / src / index.ts View on Github external
async function bootstrap() {
  try {
    $log.debug("Start server...");
    const server = await ServerLoader.bootstrap(Server);

    await server.listen();
    $log.debug("Server initialized");
  } catch (er) {
    $log.error(er);
  }
}
github TypedProject / ts-express-decorators / examples / aws / src / index.ts View on Github external
async function bootstrap() {
  try {
    $log.debug("Start server...");
    const server = await ServerLoader.bootstrap(Server);

    await server.listen();
    $log.debug("Server initialized");
  } catch (er) {
    $log.error(er);
  }
}
github TypedProject / ts-express-decorators / examples / mongoose / src / index.ts View on Github external
async function bootstrap() {
  try {
    $log.debug("Start server...");
    const server = await ServerLoader.bootstrap(Server);

    await server.listen();
    $log.debug("Server initialized");
  } catch (er) {
    $log.error(er);
  }
}
github TypedProject / ts-express-decorators / examples / multer / src / index.ts View on Github external
async function bootstrap() {
  try {
    $log.debug("Start server...");
    const server = await ServerLoader.bootstrap(Server);

    await server.listen();
    $log.debug("Server initialized");
  } catch (er) {
    $log.error(er);
  }
}
github TranBaVinhSon / microservice_nodejs_template / packages / backend / src / index.ts View on Github external
async function bootstrap() {
  try {
    $log.debug("Start server...");
    const server = await ServerLoader.bootstrap(Server);

    await server.listen();
    $log.debug("Server initialized");
    Logger();
  } catch (er) {
    $log.error(er);
  }
}