當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript eta-lib.logger類代碼示例

本文整理匯總了TypeScript中eta-lib.logger的典型用法代碼示例。如果您正苦於以下問題:TypeScript logger類的具體用法?TypeScript logger怎麽用?TypeScript logger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了logger類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

 eta.db.query(sql, result.params, (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         return;
     }
     eta.logger.trace("Successfully updated table " + tableName);
 });
開發者ID:crossroads-education,項目名稱:eta-sys,代碼行數:7,代碼來源:update-database.ts

示例2: callback

 eta.db.query(sql, [], (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         callback({ errcode: eta.http.InternalError });
         return;
     }
     eta.logger.trace("Fixed Section.");
     callback({ "status": "Success" });
 });
開發者ID:crossroads-education,項目名稱:eta-sys,代碼行數:9,代碼來源:fix-sections.ts

示例3: CURRENT_TIMESTAMP

 eta.db.query(sql, [req.session["userid"]], (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         res.redirect("/apply?error=" + querystring.escape("We were unable to process your application due to an internal error."));
         return;
     }
     let valueSql: string = "(?, ?, 1),".repeat(positions.length);
     let sql: string = `
         INSERT INTO ApplicantPosition
         (id, position, count)
         VALUES ${valueSql.substring(0, valueSql.length - 1)}
         ON DUPLICATE KEY UPDATE
             lastApplied = CURRENT_TIMESTAMP(),
             count = count + 1`;
     let params: string[] = [];
     for (let i: number = 0; i < positions.length; i++) {
         params.push(req.session["userid"]);
         params.push(positions[i]);
     }
     eta.db.query(sql, params, (err: eta.DBError, rows: any[]) => {
         if (err) {
             eta.logger.dbError(err);
             res.redirect("/apply?error=" + querystring.escape("We were unable to process your application due to an internal error."));
             return;
         }
         res.redirect("/apply?success=true");
     });
 });
開發者ID:crossroads-education,項目名稱:eta-front,代碼行數:28,代碼來源:apply.ts

示例4: callback

 HelperOracle.getConnection((err: Error, db: oracledb.IConnection) => {
     if (err) {
         eta.logger.error("Could not connect to Oracle DB: " + err.message);
         callback();
         return;
     }
     let tableDir: string = eta.server.modules["sys"].baseDir + "lib/update-database/tables/";
     fs.readdir(tableDir, (err: Error, files: string[]) => {
         if (err) {
             eta.logger.error("Could not list " + tableDir + ": " + err.message);
             callback();
             return;
         }
         for (let i: number = 0; i < files.length; i++) {
             if (!files[i].endsWith(".js")) {
                 continue;
             }
             try {
                 this.processTable(db, tableDir + files[i], term);
             } catch (ex) {
                 eta.logger.warn("Couldn't process: " + files[i] + ": " + ex.toString());
             }
         }
         callback();
     });
 });
開發者ID:crossroads-education,項目名稱:eta-sys,代碼行數:26,代碼來源:update-database.ts

示例5: callback

 eta.db.query(sql, [req.body.start, req.body.end], (err: eta.DBError, rawDays: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         callback({ errcode: eta.http.InternalError });
         return;
     }
     let days: {
         [date: string]: {
             isExamJam: boolean;
             isClosed: boolean;
         }
     } = {};
     for (let i: number = 0; i < examJamDays.length; i++) {
         rawDays.push(examJamDays[i]);
     }
     for (let i: number = 0; i < rawDays.length; i++) {
         let day: string = eta.time.getStandardDate(rawDays[i].day);
         if (!days[day]) {
             days[day] = {
                 "isExamJam": false,
                 "isClosed": false
             };
         }
         if (rawDays[i].isExamJam) {
             days[day].isExamJam = true;
         }
         if (rawDays[i].isClosed) {
             days[day].isClosed = true;
         }
     }
     callback({
         "raw": JSON.stringify(days)
     });
 });
開發者ID:crossroads-education,項目名稱:eta-front,代碼行數:34,代碼來源:get-calendar.ts

示例6:

 eta.db.query(sql, params, (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         res.redirect("/apply?error=" + querystring.escape("We were unable to process your application due to an internal error."));
         return;
     }
     res.redirect("/apply?success=true");
 });
開發者ID:crossroads-education,項目名稱:eta-front,代碼行數:8,代碼來源:apply.ts

示例7:

 }, (err: Error, info: nodemailer.SentMessageInfo) => {
     if (err) {
         eta.logger.warn("Could not send mail from " + req.body.email + ": " + err.message);
         res.redirect("/contact?error=" + querystring.escape("failed-to-send-email"));
         return;
     }
     res.redirect("/contact?success=true");
 });
開發者ID:crossroads-education,項目名稱:eta-front,代碼行數:8,代碼來源:contact.ts

示例8:

 eta.setting.set(req.body.page, req.body.name, req.body.value, req.body.type, (success: boolean) => {
     eta.logger.trace("Setting set: " + success);
     eta.setting.init();
     if (req.body.shouldRedirect) {
         res.redirect("../edit/settings?lastPage=" + querystring.escape(req.body.page));
     } else {
         res.send(success.toString());
     }
 });
開發者ID:crossroads-education,項目名稱:eta-sys,代碼行數:9,代碼來源:settings.ts

示例9: callback

 eta.db.query(sql, [], (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         callback({ errcode: eta.http.InternalError });
         return;
     }
     callback({
         "articles": rows
     });
 });
開發者ID:crossroads-education,項目名稱:eta-front,代碼行數:10,代碼來源:press.ts


注:本文中的eta-lib.logger類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。