moost 0.5.5 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -114,11 +114,10 @@ function getNewMoostInfact() {
114
114
  on: (event, targetClass, message, args) => {
115
115
  switch (event) {
116
116
  case 'new-instance': {
117
- const isForEvent = getMoostMate().read(targetClass)?.injectable !== 'SINGLETON';
118
- const isSingleton = !isForEvent;
117
+ const scope = getMoostMate().read(targetClass)?.injectable || 'SINGLETON';
119
118
  if (loggingOptions.newInstance === false ||
120
- (loggingOptions.newInstance === 'FOR_EVENT' && !isForEvent) ||
121
- (loggingOptions.newInstance === 'SINGLETON' && isSingleton)) {
119
+ loggingOptions.newInstance === scope ||
120
+ (loggingOptions.newInstance === 'SINGLETON' && scope === true)) {
122
121
  return;
123
122
  }
124
123
  break;
@@ -138,7 +137,7 @@ function getNewMoostInfact() {
138
137
  }
139
138
  let logger;
140
139
  try {
141
- logger = eventCore.useEventLogger('infact');
140
+ logger = event === 'error' ? getDefaultLogger('infact') : eventCore.useEventLogger('infact');
142
141
  }
143
142
  catch (error) {
144
143
  logger = getDefaultLogger('infact');
package/dist/index.mjs CHANGED
@@ -116,11 +116,10 @@ function getNewMoostInfact() {
116
116
  on: (event, targetClass, message, args) => {
117
117
  switch (event) {
118
118
  case 'new-instance': {
119
- const isForEvent = getMoostMate().read(targetClass)?.injectable !== 'SINGLETON';
120
- const isSingleton = !isForEvent;
119
+ const scope = getMoostMate().read(targetClass)?.injectable || 'SINGLETON';
121
120
  if (loggingOptions.newInstance === false ||
122
- (loggingOptions.newInstance === 'FOR_EVENT' && !isForEvent) ||
123
- (loggingOptions.newInstance === 'SINGLETON' && isSingleton)) {
121
+ loggingOptions.newInstance === scope ||
122
+ (loggingOptions.newInstance === 'SINGLETON' && scope === true)) {
124
123
  return;
125
124
  }
126
125
  break;
@@ -140,7 +139,7 @@ function getNewMoostInfact() {
140
139
  }
141
140
  let logger;
142
141
  try {
143
- logger = useEventLogger('infact');
142
+ logger = event === 'error' ? getDefaultLogger('infact') : useEventLogger('infact');
144
143
  }
145
144
  catch (error) {
146
145
  logger = getDefaultLogger('infact');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moost",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "moost",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",