Skip to content

Commit

Permalink
removed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni Troisi committed Jan 24, 2025
1 parent b436830 commit e9f8375
Show file tree
Hide file tree
Showing 24 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ var projectSetter = function (req, res, next) {
if (projectid) {

if (!mongoose.Types.ObjectId.isValid(projectid)) {
winston.warn(`Invalid ObjectId: ${projectid}`);
//winston.warn(`Invalid ObjectId: ${projectid}`);
return res.status(400).send({ error: "Invalid project id: " + projectid });
}

Expand All @@ -462,11 +462,11 @@ var projectSetter = function (req, res, next) {
}
q.exec(function(err, project){
if (err) {
winston.warn("Problem getting project with id: " + projectid + " req.originalUrl: " + req.originalUrl);
//winston.warn("Problem getting project with id: " + projectid + " req.originalUrl: " + req.originalUrl);
}
winston.debug("projectSetter project:" + project);
if (!project) {
winston.warn("ProjectSetter project not found with id: " + projectid);
//winston.warn("ProjectSetter project not found with id: " + projectid);
//next();
return res.status(400).send({ error: "Project not found with id: " + projectid })
} else {
Expand Down
2 changes: 1 addition & 1 deletion models/analyticResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var analyticResult= mongoose.model('analyticResult', AnalyticResultSchema);

if (process.env.MONGOOSE_SYNCINDEX) {
analyticResult.syncIndexes();
winston.info("analyticResult syncIndexes")
winston.verbose("analyticResult syncIndexes")
}


Expand Down
2 changes: 1 addition & 1 deletion models/channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var channel = mongoose.model('channel', ChannelSchema);;

if (process.env.MONGOOSE_SYNCINDEX) {
channel.syncIndexes();
winston.info("channel syncIndexes")
winston.verbose("channel syncIndexes")
}


Expand Down
2 changes: 1 addition & 1 deletion models/department.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var department = mongoose.model('department', DepartmentSchema);

if (process.env.MONGOOSE_SYNCINDEX) {
department.syncIndexes();
winston.info("department syncIndexes")
winston.verbose("department syncIndexes")
}


Expand Down
2 changes: 1 addition & 1 deletion models/faq.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ faq.on('index', function (error) {

if (process.env.MONGOOSE_SYNCINDEX) {
faq.syncIndexes();
winston.info("faq syncIndexes")
winston.verbose("faq syncIndexes")
}


Expand Down
2 changes: 1 addition & 1 deletion models/faq_kb.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ var faq_kb = mongoose.model('faq_kb', Faq_kbSchema);

if (process.env.MONGOOSE_SYNCINDEX) {
faq_kb.syncIndexes();
winston.info("faq_kb syncIndexes")
winston.verbose("faq_kb syncIndexes")
}

function generateSlug(name) {
Expand Down
2 changes: 1 addition & 1 deletion models/lead.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ LeadSchema.index({status: 1, id_project: 1, createdAt: -1});

if (process.env.MONGOOSE_SYNCINDEX) {
lead.syncIndexes();
winston.info("lead syncIndexes")
winston.verbose("lead syncIndexes")
}

module.exports = lead;
2 changes: 1 addition & 1 deletion models/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var message = mongoose.model('message', MessageSchema);

if (process.env.MONGOOSE_SYNCINDEX) {
message.syncIndexes();
winston.info("message syncIndexes")
winston.verbose("message syncIndexes")
}

module.exports = message;
2 changes: 1 addition & 1 deletion models/pending-invitation.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var pending= mongoose.model('pending-invitation', PendingInvitation);

if (process.env.MONGOOSE_SYNCINDEX) {
pending.syncIndexes();
winston.info("pending syncIndexes")
winston.verbose("pending syncIndexes")
}

module.exports = pending;
2 changes: 1 addition & 1 deletion models/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var profile =mongoose.model('profile', ProfileSchema);

if (process.env.MONGOOSE_SYNCINDEX) {
profile.syncIndexes();
winston.info("profile syncIndexes")
winston.verbose("profile syncIndexes")
}


Expand Down
2 changes: 1 addition & 1 deletion models/property.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var property = mongoose.model('property', PropertySchema);

if (process.env.MONGOOSE_SYNCINDEX) {
property.syncIndexes();
winston.info("property syncIndexes")
winston.verbose("property syncIndexes")
}

module.exports = property;
2 changes: 1 addition & 1 deletion models/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ RequestSchema.index({ id_project: 1, preflight: 1, smartAssignment: 1, "snapshot
var request = mongoose.model('request', RequestSchema);
if (process.env.MONGOOSE_SYNCINDEX) {
request.syncIndexes();
winston.info("message syncIndexes")
winston.verbose("message syncIndexes")

}

Expand Down
2 changes: 1 addition & 1 deletion models/requester.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var requester = mongoose.model('requester', RequesterSchema);

if (process.env.MONGOOSE_SYNCINDEX) {
requester.syncIndexes();
winston.info("requester syncIndexes")
winston.verbose("requester syncIndexes")
}

module.exports = requester;
2 changes: 1 addition & 1 deletion models/segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var segment = mongoose.model('segment', SegmentSchema);

if (process.env.MONGOOSE_SYNCINDEX) {
segment.syncIndexes();
winston.info("segment syncIndexes")
winston.verbose("segment syncIndexes")
}

module.exports = segment;
2 changes: 1 addition & 1 deletion models/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var setting = mongoose.model('Setting', SettingSchema);

if (process.env.MONGOOSE_SYNCINDEX) {
setting.syncIndexes();
winston.info("setting syncIndexes")
winston.verbose("setting syncIndexes")
}


Expand Down
2 changes: 1 addition & 1 deletion models/subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var subscription = mongoose.model('subscription', SubscriptionSchema);

if (process.env.MONGOOSE_SYNCINDEX) {
subscription.syncIndexes();
winston.info("subscription syncIndexes")
winston.verbose("subscription syncIndexes")
}

module.exports = subscription;
2 changes: 1 addition & 1 deletion models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ var UserModel = mongoose.model('user', UserSchema);

if (process.env.MONGOOSE_SYNCINDEX) {
UserModel.syncIndexes();
winston.info("UserModel syncIndexes")
winston.verbose("UserModel syncIndexes")
}

module.exports = UserModel;
2 changes: 1 addition & 1 deletion routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ router.get(
"/keycloak/callback",
passport.authenticate("keycloak"),
function(req, res) {
winston.info("'/keycloak/callback: ");
winston.verbose("'/keycloak/callback: ");
// Successful authentication, redirect home.
res.redirect('/');
}
Expand Down
6 changes: 3 additions & 3 deletions routes/auth_newjwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function (req, res) {

authEvent.emit("projectuser.create", savedProject_user);

winston.info('project user created ', savedProject_user.toObject());
winston.verbose('project user created ', savedProject_user.toObject());


// JWT_HERE
Expand Down Expand Up @@ -215,14 +215,14 @@ router.post('/signinWithCustomToken', [

authEvent.emit("projectuser.create", savedProject_user);

winston.info('project user created ', savedProject_user.toObject());
winston.verbose('project user created ', savedProject_user.toObject());



return res.json({ success: true, token: req.headers["authorization"], user: req.user });
});
}else {
winston.info('project user already exists ');
winston.verbose('project user already exists ');
return res.json({ success: true, token: req.headers["authorization"], user: req.user });
}

Expand Down
4 changes: 2 additions & 2 deletions routes/campaigns.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var Segment2MongoConverter = require("../utils/segment2mongoConverter");
var JobManager = require("jobs-worker-queued");

var JOB_RABBITURI = process.env.JOB_RABBITURI;
winston.info("JobWorkerQueued uri: " + JOB_RABBITURI);
winston.verbose("JobWorkerQueued uri: " + JOB_RABBITURI);

var jobManager = new JobManager(JOB_RABBITURI,
{
Expand Down Expand Up @@ -44,7 +44,7 @@ router.post('/', function (req, res) {
req.body.text, req.body.departmentid, req.body.sourcePage,
req.body.language, req.body.userAgent, null, req.user._id, req.body.attributes, req.body.subject, true, req.body.channel).then(function (savedRequest) {

winston.info("savedRequest", savedRequest);
winston.debug("savedRequest", savedRequest);

// create(sender, senderFullname, recipient, text, id_project, createdBy, status, attributes, type, metadata, language, channel_type) {
return messageService.create(req.body.sender || req.user._id, req.body.senderFullname || req.user.fullName, savedRequest.request_id, req.body.text,
Expand Down
2 changes: 1 addition & 1 deletion routes/kb.js
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ async function scheduleScrape(resources) {
winston.error("Scheduling error: ", err);
error_code = 400;
} else {
winston.info("Scheduling result: ", result);
winston.verbose("Scheduling result: ", result);
}
await updateStatus(r.id, error_code);
});
Expand Down
2 changes: 1 addition & 1 deletion routes/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -2362,7 +2362,7 @@ async function scheduleTags(id_project, tags) {
if (err) {
winston.error("Scheduling error: ", err);
} else {
winston.info("Scheduling result: ", result);
winston.verbose("Scheduling result: ", result);
}
})
})
Expand Down
2 changes: 1 addition & 1 deletion services/chatbotService.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ChatbotService {
},
method: 'GET'
}).then((resbody) => {
winston.info("(CHATBOT SERVICE) forking public chatbot " + resbody.data.name);
winston.debug("(CHATBOT SERVICE) forking public chatbot " + resbody.data.name);
let chatbot = resbody.data;
return chatbot
}).catch((err) => {
Expand Down
4 changes: 2 additions & 2 deletions services/openaiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ class OpenaiService {
}

getContentChunks(namespace_id, content_id, engine) {
winston.info("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_train);
winston.info(kb_endpoint_train + "/id/" + content_id + "/namespace/" + namespace_id)
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_train);

return new Promise((resolve, reject) => {

let payload = { engine: engine };
Expand Down

0 comments on commit e9f8375

Please sign in to comment.