-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lets the watcher CLI show some logs in debug/trace and others all the time (and adds duration) #8591
Conversation
orta
commented
Jun 12, 2023
- I copied the colour/style format of the functions CLI output,
- Moved output like files created into something which is only available when LOG_LEVEL is trace
- Logs the time it takes to generate types for any section
- Traces when the fs message is received, and not just when something has happened
level: logLevel, | ||
redact: redactionsList, | ||
} | ||
} satisfies LoggerOptions | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new TS 4.9 feature, lets you say "this object must conform to this type" but doesn't force the type to be that type to other objects.
What this means is that I can access defaultLoggerOptions.level
without a ?
because it's not LoggerOptions
's string | undefined
but this object's string
.
packages/internal/src/cliLogger.ts
Outdated
|
||
cliLogger.trace = | ||
logLevel === 'trace' || logLevel === 'debug' ? console.log : () => {} | ||
cliLogger.debug = logLevel === 'debug' ? console.log : () => {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function
objects have special cases for Expandos which let them be lazily checked so you can append extra properties to the type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @orta, just tried to test this one out locally but ran into a few things and left a few suggestions
Thanks Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>
Thanks! I've been having issues with |
@orta just merged that PR that fixed project:sync. Very sure that it should be back to being solid now but let me know if anything comes up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good @orta but found one bug in the level config, let me know what you think
I got this running locally now, and agree - switched the fns around |
Thanks @orta! Awesome I'll handle getting this merged |