Skip to content

Commit

Permalink
add debugging for Photon Go ❤️
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Dec 19, 2019
1 parent ff85b6c commit 9d2216c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/sdk/src/Generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ import {
GeneratorManifest,
BinaryPaths,
} from '@prisma/generator-helper'
import Debug from 'debug'

export class Generator {
private generatorProcess: GeneratorProcess
private debug: Debug.Debugger
public manifest: GeneratorManifest | null = null
public options?: GeneratorOptions
constructor(private executablePath: string) {
this.generatorProcess = new GeneratorProcess(this.executablePath)
this.debug = Debug(`Generator:${executablePath}`)
}
async init() {
await this.generatorProcess.init()
this.debug(`Sending "getManifest" rpc to generator`)
this.manifest = await this.generatorProcess.getManifest()
}
stop() {
Expand All @@ -25,6 +29,7 @@ export class Generator {
`Please first run .setOptions() on the Generator to initialize the options`,
)
}
this.debug(`Sending "generate" rpc to generator`)
return this.generatorProcess.generate(this.options)
}
setOptions(options: GeneratorOptions) {
Expand Down

0 comments on commit 9d2216c

Please sign in to comment.