Skip to content

Commit 766877d

Browse files
committed
use logger and not console log
1 parent aa997b3 commit 766877d

3 files changed

Lines changed: 10 additions & 15 deletions

File tree

OpenFlow/src/DatabaseConnection.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,29 +124,29 @@ export class DatabaseConnection {
124124
ace.name = arr[0].name;
125125
if (Config.multi_tenant && multi_tenant_skip.indexOf(item._id) > -1) {
126126
// when multi tenant don't allow members of common user groups to see each other
127-
console.log("Running in multi tenant mode, skip adding permissions for " + item.name);
127+
this._logger.info("Running in multi tenant mode, skip adding permissions for " + item.name);
128128
} else if (arr[0]._type == "user") {
129129
var u: User = User.assign(arr[0]);
130130
if (!u.hasRight(item._id, Rights.read)) {
131-
console.log("Assigning " + item.name + " read permission to " + u.name);
131+
this._logger.debug("Assigning " + item.name + " read permission to " + u.name);
132132
u.addRight(item._id, item.name, [Rights.read], false);
133133

134134
await this.db.collection("users").updateOne({ _id: u._id }, { $set: { _acl: u._acl } });
135135
// await this.db.collection("users").save(u);
136136
} else if (u._id != item._id) {
137-
console.log(item.name + " allready exists on " + u.name);
137+
this._logger.debug(item.name + " allready exists on " + u.name);
138138
}
139139
} else if (arr[0]._type == "role") {
140140
var r: Role = Role.assign(arr[0]);
141141
if (r._id == WellknownIds.admins || r._id == WellknownIds.users) {
142142
}
143143
if (!r.hasRight(item._id, Rights.read)) {
144-
console.log("Assigning " + item.name + " read permission to " + r.name);
144+
this._logger.debug("Assigning " + item.name + " read permission to " + r.name);
145145
r.addRight(item._id, item.name, [Rights.read], false);
146146
await this.db.collection("users").updateOne({ _id: r._id }, { $set: { _acl: r._acl } });
147147
// await this.db.collection("users").save(r);
148148
} else if (r._id != item._id) {
149-
console.log(item.name + " allready exists on " + r.name);
149+
this._logger.debug(item.name + " allready exists on " + r.name);
150150
}
151151

152152
}
@@ -176,7 +176,7 @@ export class DatabaseConnection {
176176
if (arr.length == 1 && item._id != WellknownIds.admins && item._id != WellknownIds.root) {
177177
if (Config.multi_tenant && multi_tenant_skip.indexOf(item._id) > -1) {
178178
// when multi tenant don't allow members of common user groups to see each other
179-
console.log("Running in multi tenant mode, skip removing permissions for " + item.name);
179+
this._logger.info("Running in multi tenant mode, skip removing permissions for " + item.name);
180180
} else if (arr[0]._type == "user") {
181181
var u: User = User.assign(arr[0]);
182182
if (u.hasRight(item._id, Rights.read)) {
@@ -185,14 +185,14 @@ export class DatabaseConnection {
185185
// was read the only right ? then remove it
186186
var right = u.getRight(item._id, false);
187187
if (right == null) {
188-
console.log("Removing " + item.name + " read permissions from " + u.name);
188+
this._logger.debug("Removing " + item.name + " read permissions from " + u.name);
189189
// await this.db.collection("users").save(u);
190190
await this.db.collection("users").updateOne({ _id: u._id }, { $set: { _acl: u._acl } });
191191

192192
}
193193

194194
} else {
195-
console.log("No need to remove " + item.name + " read permissions from " + u.name);
195+
this._logger.debug("No need to remove " + item.name + " read permissions from " + u.name);
196196
}
197197
} else if (arr[0]._type == "role") {
198198
var r: Role = Role.assign(arr[0]);
@@ -202,13 +202,13 @@ export class DatabaseConnection {
202202
// was read the only right ? then remove it
203203
var right = r.getRight(item._id, false);
204204
if (right == null) {
205-
console.log("Removing " + item.name + " read permissions from " + r.name);
205+
this._logger.debug("Removing " + item.name + " read permissions from " + r.name);
206206
// await this.db.collection("users").save(r);
207207
await this.db.collection("users").updateOne({ _id: r._id }, { $set: { _acl: r._acl } });
208208
}
209209

210210
} else {
211-
console.log("No need to remove " + item.name + " read permissions from " + u.name);
211+
this._logger.debug("No need to remove " + item.name + " read permissions from " + u.name);
212212
}
213213
}
214214

OpenFlow/src/KubeUtil.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export class KubeUtil {
5252
var item = list.body.items[i];
5353
if (item.metadata && item.metadata.labels) {
5454
var value = item.metadata.labels[labelskey];
55-
console.log(value);
5655
if (value == labelsvalue) return item;
5756
}
5857
}

OpenFlow/src/LoginProvider.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,6 @@ export class LoginProvider {
651651
return strategy;
652652
}
653653
static async samlverify(profile: any, done: IVerifyFunction): Promise<void> {
654-
console.log("samlverify");
655-
console.log(JSON.stringify(profile));
656654
var username: string = (profile.nameID || profile.username);
657655
if (username !== null && username != undefined) { username = username.toLowerCase(); }
658656
this._logger.debug("verify: " + username);
@@ -725,8 +723,6 @@ export class LoginProvider {
725723
var createUser: boolean = Config.auto_create_users;
726724
if (Config.auto_create_domains.map(x => username.endsWith(x)).length == -1) { createUser = false; }
727725
if (createUser) {
728-
console.log("createUser");
729-
console.log(JSON.stringify(profile));
730726
var jwt: string = TokenUser.rootToken();
731727
_user = new User(); _user.name = profile.name;
732728
if (!Util.IsNullEmpty(profile.displayName)) { _user.name = profile.displayName; }

0 commit comments

Comments
 (0)