-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1614 from salesforcecli/mdonnalley/core-v4
feat: use oclif/core v4
- Loading branch information
Showing
16 changed files
with
216 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
#!/usr/bin/env ts-node | ||
|
||
async function main() { | ||
const oclif = await import('@oclif/core'); | ||
oclif.settings.performanceEnabled = true; | ||
await oclif.execute({ development: true, dir: import.meta.url }); | ||
const { settings } = await import('@oclif/core/settings'); | ||
const { execute } = await import('@oclif/core/execute'); | ||
|
||
settings.performanceEnabled = true; | ||
await execute({ development: true, dir: import.meta.url }); | ||
} | ||
|
||
await main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2023, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
import { format } from 'node:util'; | ||
import Interfaces from '@oclif/core/interfaces'; | ||
import { Logger } from '@salesforce/core/logger'; | ||
|
||
const customLogger = (namespace: string): Interfaces.Logger => { | ||
const sfLogger = new Logger(namespace); | ||
return { | ||
child: (ns: string, delimiter?: string) => customLogger(`${namespace}${delimiter ?? ':'}${ns}`), | ||
debug: (formatter: unknown, ...args: unknown[]) => sfLogger.debug(format(formatter, ...args)), | ||
error: (formatter: unknown, ...args: unknown[]) => sfLogger.error(format(formatter, ...args)), | ||
info: (formatter: unknown, ...args: unknown[]) => sfLogger.info(format(formatter, ...args)), | ||
trace: (formatter: unknown, ...args: unknown[]) => sfLogger.trace(format(formatter, ...args)), | ||
warn: (formatter: unknown, ...args: unknown[]) => sfLogger.warn(format(formatter, ...args)), | ||
namespace, | ||
}; | ||
}; | ||
|
||
export const logger = customLogger('sf:oclif'); | ||
export const sfStartupLogger = customLogger('sf-startup'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.