Skip to content

Commit ded09c9

Browse files
committed
turn down logging
1 parent a201d95 commit ded09c9

8 files changed

Lines changed: 16 additions & 42 deletions

File tree

OpenFlow/src/DatabaseConnection.ts

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ export class DatabaseConnection {
639639
if ((hasUser === null || hasUser === undefined)) {
640640
Base.addRight(item, user._id, user.name, [Rights.full_control]);
641641
}
642-
if (collectionname != "audit") { this._logger.debug("[" + user.username + "][" + collectionname + "] Adding " + item._type + " " + name + " to database"); }
642+
if (collectionname != "audit") { this._logger.silly("[" + user.username + "][" + collectionname + "] Adding " + item._type + " " + name + " to database"); }
643643
if (!this.hasAuthorization(user, item, Rights.create)) { throw new Error("Access denied, no authorization to InsertOne " + item._type + " " + name + " to database"); }
644644

645645
item = this.encryptentity(item) as T;
@@ -1012,7 +1012,7 @@ export class DatabaseConnection {
10121012
(q.item["$set"])._modified = new Date(new Date().toISOString());
10131013

10141014

1015-
this._logger.debug("[" + user.username + "][" + q.collectionname + "] UpdateMany " + (q.item.name || q.item._name) + " in database");
1015+
this._logger.silly("[" + user.username + "][" + q.collectionname + "] UpdateMany " + (q.item.name || q.item._name) + " in database");
10161016

10171017
q.j = ((q.j as any) === 'true' || q.j === true);
10181018
if ((q.w as any) !== "majority") q.w = parseInt((q.w as any));
@@ -1078,15 +1078,15 @@ export class DatabaseConnection {
10781078
if (!this.hasAuthorization(user, q.item, Rights.update)) { throw new Error("Access denied, no authorization to InsertOrUpdateOne"); }
10791079
// if (q.item._id !== null && q.item._id !== undefined && q.item._id !== "") {
10801080
if (exists.length == 1) {
1081-
this._logger.debug("[" + user.username + "][" + q.collectionname + "] InsertOrUpdateOne, Updating found one in database");
1081+
this._logger.silly("[" + user.username + "][" + q.collectionname + "] InsertOrUpdateOne, Updating found one in database");
10821082
const uq = new UpdateOneMessage();
10831083
// uq.query = query;
10841084
uq.item = q.item; uq.collectionname = q.collectionname; uq.w = q.w; uq.j; uq.jwt = q.jwt;
10851085
const uqres = await this.UpdateOne(uq);
10861086
q.opresult = uqres.opresult;
10871087
q.result = uqres.result;
10881088
} else {
1089-
this._logger.debug("[" + user.username + "][" + q.collectionname + "] InsertOrUpdateOne, Inserting as new in database");
1089+
this._logger.silly("[" + user.username + "][" + q.collectionname + "] InsertOrUpdateOne, Inserting as new in database");
10901090
q.result = await this.InsertOne(q.item, q.collectionname, q.w, q.j, q.jwt);
10911091
}
10921092
return q;
@@ -1116,16 +1116,11 @@ export class DatabaseConnection {
11161116
if (id === null || id === undefined || id === "") { throw Error("id cannot be null"); }
11171117
await this.connect();
11181118
const user: TokenUser = Crypt.verityToken(jwt);
1119-
// const original:Base = await this.getbyid(id, collectionname, jwt);
1120-
// if(!original) { throw Error("item not found!"); }
1121-
// if(!this.hasAuthorization(user, original, "delete")) { throw new Error("Access denied, no authorization to DeleteOne"); }
11221119
let _query: any = {};
11231120
if (typeof id === 'string' || id instanceof String) {
11241121
_query = { $and: [{ _id: id }, this.getbasequery(jwt, "_acl", [Rights.delete])] };
1125-
//_query = { $and: [{ _id: { $ne: user._id } }, _query] };
11261122
} else {
11271123
_query = { $and: [{ id }, this.getbasequery(jwt, "_acl", [Rights.delete])] };
1128-
//_query = { $and: [{ _id: { $ne: user._id } }, _query] };
11291124
}
11301125

11311126
if (collectionname === "files") { collectionname = "fs.files"; }
@@ -1139,29 +1134,8 @@ export class DatabaseConnection {
11391134
throw Error("item not found!");
11401135
}
11411136
}
1142-
1143-
1144-
// const arr = await this.db.collection(collectionname).find(_query).toArray();
1145-
1146-
this._logger.debug("[" + user.username + "][" + collectionname + "] Deleting " + id + " in database");
1137+
this._logger.silly("[" + user.username + "][" + collectionname + "] Deleting " + id + " in database");
11471138
const res: DeleteWriteOpResultObject = await this.db.collection(collectionname).deleteOne(_query);
1148-
1149-
// const res:DeleteWriteOpResultObject = await this.db.collection(collectionname).deleteOne({_id:id});
1150-
// const res:DeleteWriteOpResultObject = await this.db.collection(collectionname).deleteOne(id);
1151-
if (res.deletedCount === 0) { throw Error("item not found!"); } else {
1152-
// try {
1153-
// const item: any = { _id: id, };
1154-
// item._modifiedby = user.name;
1155-
// item._modifiedbyid = user._id;
1156-
// item._modified = new Date(new Date().toISOString());
1157-
// item._deletedby = user.name;
1158-
// item._deletedbyid = user._id;
1159-
// item._deleted = new Date(new Date().toISOString());
1160-
// await this.SaveDiff(collectionname, null, item);
1161-
// } catch (error) {
1162-
// console.error(error)
1163-
// }
1164-
}
11651139
}
11661140

11671141
/**

OpenFlowNodeRED/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openflow-nodered",
3-
"version": "1.1.70",
3+
"version": "1.1.71",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.70
1+
1.1.71

docker-compose-toolbox.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ services:
4545
- "traefik.http.routers.web.rule=Host(`toolbox.openrpa.dk`)"
4646
- "traefik.http.routers.web.entrypoints=web"
4747
- "traefik.frontend.passHostHeader=true"
48-
image: "cloudhack/openflow:1.1.70"
48+
image: "cloudhack/openflow:1.1.71"
4949
container_name: "web"
5050
environment:
5151
- update_acl_based_on_groups=true
@@ -82,7 +82,7 @@ services:
8282
- "traefik.http.routers.nodered.rule=Host(`nodered1.toolbox.openrpa.dk`)"
8383
- "traefik.http.routers.nodered.entrypoints=web"
8484
- "traefik.http.services.nodered.loadbalancer.server.port=1880"
85-
image: "cloudhack/openflownodered:1.1.70"
85+
image: "cloudhack/openflownodered:1.1.71"
8686
container_name: "nodered"
8787
environment:
8888
# - nodered_id=1

docker-compose-traefik-letsencrypt.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ services:
6969
- "traefik.http.routers.web.entrypoints=web,websecure"
7070
- "traefik.frontend.passHostHeader=true"
7171
- "traefik.http.routers.web.tls.certresolver=myresolver"
72-
image: "cloudhack/openflow:1.1.70"
72+
image: "cloudhack/openflow:1.1.71"
7373
container_name: "web"
7474
environment:
7575
- update_acl_based_on_groups=true
@@ -107,7 +107,7 @@ services:
107107
- "traefik.http.routers.nodered.entrypoints=web,websecure"
108108
- "traefik.http.services.nodered.loadbalancer.server.port=1880"
109109
- "traefik.http.routers.nodered.tls.certresolver=myresolver"
110-
image: "cloudhack/openflownodered:1.1.70"
110+
image: "cloudhack/openflownodered:1.1.71"
111111
container_name: "nodered"
112112
environment:
113113
# - nodered_id=1

docker-compose-traefik.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ services:
4545
- "traefik.http.routers.web.rule=Host(`localhost.openrpa.dk`)"
4646
- "traefik.http.routers.web.entrypoints=web"
4747
- "traefik.frontend.passHostHeader=true"
48-
image: "cloudhack/openflow:1.1.70"
48+
image: "cloudhack/openflow:1.1.71"
4949
container_name: "web"
5050
environment:
5151
- update_acl_based_on_groups=true
@@ -82,7 +82,7 @@ services:
8282
- "traefik.http.routers.nodered.rule=Host(`nodered1.localhost.openrpa.dk`)"
8383
- "traefik.http.routers.nodered.entrypoints=web"
8484
- "traefik.http.services.nodered.loadbalancer.server.port=1880"
85-
image: "cloudhack/openflownodered:1.1.70"
85+
image: "cloudhack/openflownodered:1.1.71"
8686
container_name: "nodered"
8787
environment:
8888
# - nodered_id=1

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
- "5672:5672"
1919
- "15672:15672"
2020
web:
21-
image: "cloudhack/openflow:1.1.70"
21+
image: "cloudhack/openflow:1.1.71"
2222
environment:
2323
- update_acl_based_on_groups=true
2424
- multi_tenant=false
@@ -52,7 +52,7 @@ services:
5252
- "80:80"
5353
- "5858:5858"
5454
nodered:
55-
image: "cloudhack/openflownodered:1.1.70"
55+
image: "cloudhack/openflownodered:1.1.71"
5656
environment:
5757
# - nodered_id=1
5858
- nodered_sa=nodered1

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openiap",
3-
"version": "1.1.70",
3+
"version": "1.1.71",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)