|
14 | 14 |
|
15 | 15 | 'use strict'; |
16 | 16 |
|
17 | | -const debug = require('debug')('hyperledger-composer'); |
| 17 | +const Logger = require('./log/logger'); |
| 18 | +const LOG = Logger.getLog('Factory'); |
18 | 19 | const Globalize = require('./globalize'); |
19 | 20 |
|
20 | 21 | const ModelUtil = require('./modelutil'); |
@@ -79,6 +80,7 @@ class Factory { |
79 | 80 | * @throws {TypeNotFoundException} if the type is not registered with the ModelManager |
80 | 81 | */ |
81 | 82 | newResource(ns, type, id, options) { |
| 83 | + const method = 'newResource'; |
82 | 84 | options = options || {}; |
83 | 85 |
|
84 | 86 | if(typeof(id) !== 'string') { |
@@ -127,7 +129,7 @@ class Factory { |
127 | 129 | // if we have an identifier, we set it now |
128 | 130 | let idField = classDecl.getIdentifierFieldName(); |
129 | 131 | newObj[idField] = id; |
130 | | - debug('Factory.newResource created %s', id ); |
| 132 | + LOG.debug(method, 'Factory.newResource created', id ); |
131 | 133 | return newObj; |
132 | 134 | } |
133 | 135 |
|
@@ -173,7 +175,7 @@ class Factory { |
173 | 175 | newObj.assignFieldDefaults(); |
174 | 176 | this.initializeNewObject(newObj, classDecl, options); |
175 | 177 |
|
176 | | - debug('Factory.newResource created concept %s', classDecl.getFullyQualifiedName() ); |
| 178 | + LOG.debug('Factory.newResource created concept', classDecl.getFullyQualifiedName() ); |
177 | 179 | return newObj; |
178 | 180 | } |
179 | 181 |
|
|
0 commit comments