gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 01/02: logging


From: gnunet
Subject: [taler-wallet-core] 01/02: logging
Date: Fri, 24 Jul 2020 10:08:44 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

commit 2208d3c4a0a05d33c51e1e91f5af296fc9d0f8eb
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Fri Jul 24 00:25:49 2020 +0530

    logging
---
 src/crypto/workers/cryptoApi.ts | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/crypto/workers/cryptoApi.ts b/src/crypto/workers/cryptoApi.ts
index 14964e4d..5e922ec0 100644
--- a/src/crypto/workers/cryptoApi.ts
+++ b/src/crypto/workers/cryptoApi.ts
@@ -45,6 +45,9 @@ import {
 } from "../../types/walletTypes";
 
 import * as timer from "../../util/timer";
+import { Logger } from "../../util/logging";
+
+const logger = new Logger("cryptoApi.ts");
 
 /**
  * State of a crypto worker.
@@ -144,15 +147,13 @@ export class CryptoApi {
    */
   private stopped = false;
 
-  static enableTracing = false;
-
   /**
    * Terminate all worker threads.
    */
   terminateWorkers(): void {
     for (const worker of this.workers) {
       if (worker.w) {
-        CryptoApi.enableTracing && console.log("terminating worker");
+        logger.trace("terminating worker");
         worker.w.terminate();
         if (worker.terminationTimerHandle) {
           worker.terminationTimerHandle.clear();
@@ -177,9 +178,7 @@ export class CryptoApi {
    */
   wake(ws: WorkerState, work: WorkItem): void {
     if (this.stopped) {
-      console.log("cryptoApi is stopped");
-      CryptoApi.enableTracing &&
-        console.log("not waking, as cryptoApi is stopped");
+      logger.trace("cryptoApi is stopped");
       return;
     }
     if (ws.currentWorkItem !== null) {
@@ -282,12 +281,6 @@ export class CryptoApi {
       return;
     }
 
-    CryptoApi.enableTracing &&
-      console.log(
-        `rpc ${currentWorkItem.operation} took ${
-          timer.performanceNow() - currentWorkItem.startTime
-        }ms`,
-      );
     currentWorkItem.resolve(msg.data.result);
   }
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]