Skip to content

Commit 9f85230

Browse files
committed
remove some logs (#71)
1 parent 4a5e7a9 commit 9f85230

File tree

3 files changed

+10
-70
lines changed

3 files changed

+10
-70
lines changed

src/db.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,8 @@ DatabaseCollection.prototype.insert = function insert(document) {
729729
$metamodel.prepareObject(obj, $metamodel.getModel(this.name));
730730

731731
exports.store[this.name][obj[$mson.ID]] = obj;
732-
result.push(obj[$mson.ID]);
733732

734-
$log.documentInserted(obj[$mson.ID], this.name);
733+
result.push(obj[$mson.ID]);
735734

736735
Component = $component.get(this.name);
737736
if (Component) {
@@ -873,12 +872,6 @@ DatabaseCollection.prototype.update = function update(query, update, options) {
873872

874873
docs[i][attributeName] = update[attributeName];
875874

876-
$log.documentUpdated(
877-
docs[i][$mson.ID],
878-
this.name,
879-
attributeName,
880-
update[attributeName]
881-
);
882875
result.push(docs[i][$mson.ID]);
883876

884877
if ($helper.isRuntime() && $helper.getRuntime().require('db')) {
@@ -936,12 +929,6 @@ DatabaseCollection.prototype.update = function update(query, update, options) {
936929

937930
docs[i][attributeName] = update[attributeName];
938931

939-
$log.documentUpdated(
940-
docs[i][$mson.ID],
941-
this.name,
942-
attributeName,
943-
update[attributeName]
944-
);
945932
result.push(docs[i][$mson.ID]);
946933

947934
if ($helper.isRuntime() && $helper.getRuntime().require('db')) {
@@ -1002,7 +989,6 @@ DatabaseCollection.prototype.remove = function remove(query) {
1002989

1003990
delete exports.store[this.name][id];
1004991

1005-
$log.documentRemoved(id, this.name);
1006992
result.push(id);
1007993

1008994
component = $component.get(id);
@@ -1038,7 +1024,6 @@ DatabaseCollection.prototype.remove = function remove(query) {
10381024

10391025
delete exports.store[this.name][id];
10401026

1041-
$log.documentRemoved(id, this.name);
10421027
result.push(id);
10431028

10441029
component = $component.get(id);
@@ -1070,8 +1055,6 @@ DatabaseCollection.prototype.remove = function remove(query) {
10701055

10711056
delete exports.store[this.name][id];
10721057

1073-
$log.documentRemoved(id, this.name);
1074-
10751058
if (coreDb.indexOf(this.name) === -1) {
10761059
component = $component.get(id);
10771060
if (component) {

src/log.js

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,54 +1206,3 @@ exports.historyDocumentUpdated = function historyDocumentRemoved(
12061206
"')"
12071207
);
12081208
};
1209-
1210-
/**
1211-
* @method documentRemoved
1212-
* @param {String} id id of the document
1213-
* @param {String} collection name of the collection
1214-
* @description A document from a collection was removed
1215-
*/
1216-
exports.documentRemoved = function documentRemoved(id, collection) {
1217-
getLogger().debug(
1218-
"the document '" + id + "' was removed (collection '" + collection + "')"
1219-
);
1220-
};
1221-
1222-
/**
1223-
* @method documentInserted
1224-
* @param {String} id id of the document
1225-
* @param {String} collection name of the collection
1226-
* @description A document was inserted into a collection
1227-
*/
1228-
exports.documentInserted = function documentInserted(id, collection) {
1229-
getLogger().debug(
1230-
"the document '" + id + "' was inserted (collection '" + collection + "')"
1231-
);
1232-
};
1233-
1234-
/**
1235-
* @method documentUpdated
1236-
* @param {String} id id of the document
1237-
* @param {String} collection name of the collection
1238-
* @param {String} property property of the document
1239-
* @param {String} value new value of the property
1240-
* @description A document was updated
1241-
*/
1242-
exports.documentUpdated = function documentUpdated(
1243-
id,
1244-
collection,
1245-
property,
1246-
value
1247-
) {
1248-
getLogger().debug(
1249-
"the property '" +
1250-
property +
1251-
"' of the document '" +
1252-
id +
1253-
"' was updated with the value '" +
1254-
value +
1255-
"' (collection '" +
1256-
collection +
1257-
"')"
1258-
);
1259-
};

test/module/db-spec.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,15 @@ describe('System Runtime db component', () => {
150150
});
151151

152152
it('can add a document', () => {
153-
const docAdded = db._Runtime.insert({
153+
let docAdded = db._Runtime.insert({
154+
'_id': 'runtime1',
155+
'version': '0.0.0'
156+
});
157+
158+
expect(docAdded[0]).equal('runtime1');
159+
160+
// try to insert the same document
161+
docAdded = db._Runtime.insert({
154162
'_id': 'runtime1',
155163
'version': '0.0.0'
156164
});

0 commit comments

Comments
 (0)