Skip to content

Commit

Permalink
Merge pull request #1372 from Oneirocom/benbot/quick-output-log-fix
Browse files Browse the repository at this point in the history
changes output node logging to be more descriptive
  • Loading branch information
benbot authored Oct 30, 2023
2 parents 5f9e5c9 + 579d2ab commit 818f95c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/shared/src/nodes/io/Output.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// DOCUMENTED
import Rete from '@magickml/rete'
import { getLogger } from '@magickml/core'
import { v4 as uuidv4 } from 'uuid'

import { DropdownControl } from '../../dataControls/DropdownControl'
Expand Down Expand Up @@ -27,6 +28,8 @@ const defaultOutputTypes = [
},
]

const logger = getLogger();

/**
* Output component
*/
Expand Down Expand Up @@ -162,9 +165,9 @@ export class Output extends MagickComponent<void> {
const t = agent.outputTypes.find(t => t.name === outputType)
// Find outputType in outputTypes where name is outputType
if (!t) {
console.error('output type is not defined', t)
logger.error({ outputType, finalType: t }, 'Output type is not defined')
} else if (!t.handler) {
console.error('output type handler is not defined', t)
logger.error({ outputType, finalType: t }, 'Output type is not defined')
} else {
t.handler({
output,
Expand Down

0 comments on commit 818f95c

Please sign in to comment.