Skip to content

Commit 57472ec

Browse files
committed
improve logs
1 parent 7f264b9 commit 57472ec

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ function createClass(classId) {
802802
true
803803
)
804804
) {
805-
$log.invalidParameters(classId);
805+
$log.invalidParameters(classId, config);
806806
}
807807

808808
$metamodel.prepareObject(config, $metamodel.getModel(classId));

src/log.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ exports.invalidClassName = function invalidClassName(
212212
*/
213213
exports.missingProperty = function missingProperty(propertyName) {
214214
getLogger().warn(
215-
"missing property '" + propertyName + "' for a schema or a model"
215+
"property '" + propertyName + "' is missing"
216216
);
217217
};
218218

@@ -821,13 +821,16 @@ exports.invalidModel = function invalidModel(name) {
821821
/**
822822
* @method invalidParameters
823823
* @param {String} classId class name of the component
824+
* @param {String} document document
824825
* @description Invalid parameters set when creating an instance of a class
825826
*/
826-
exports.invalidParameters = function invalidParameters(classId) {
827+
exports.invalidParameters = function invalidParameters(classId, document) {
828+
var id = document && document._id ? document._id : '';
829+
827830
getLogger().warn(
828-
"the parameters for creating a component of class '" +
831+
"the parameters for creating '" + id + "' component (" +
829832
classId +
830-
"' are not compliant with the model"
833+
" model) are not compliant with the model"
831834
);
832835
};
833836

0 commit comments

Comments
 (0)