-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: added log file streaming #3
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
Conversation
src/filelogger.ts
Outdated
|
||
export class FileLogger { | ||
private readonly filename: string | ||
private readonly dirname: string |
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.
use private property methods instead, aka #dirname
src/filelogger.ts
Outdated
|
||
private _stat() { | ||
//check if file exists | ||
if (existsSync(this.filename)) { |
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.
existsSync
is deprecated, you should use fs.access
API with a special code, I think it's F_OK
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No new dependency issues detected in pull request Bot CommandsTo ignore an alert, reply with a comment starting with Pull request alert summary
|
I was getting this error during build > @tinyhttp/logger@1.3.4 build C:\Users\aaron\Documents\projects\logger
> rollup -c
(node:33272) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
src/index.ts → dist...
(!) Plugin typescript: @rollup/plugin-typescript TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.
src/filelogger.ts: (9:5)
9 this.#dirname = directoryname(filename)
~~~~~~~~~~~~~
(!) Plugin typescript: @rollup/plugin-typescript: Rollup 'sourcemap' option must be set to generate source maps.
(!) Plugin typescript: @rollup/plugin-typescript: outputToFilesystem option is defaulting to true.
(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
fs (imported by "src/filelogger.ts")
path (imported by "src/filelogger.ts")
created dist in 2.3s hence I added tslib |
package.json
Outdated
"eslint-plugin-prettier": "^4.2.1", | ||
"expect": "^29.5.0", | ||
"husky": "^8.0.3", | ||
"install": "^0.13.0", |
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.
what's this dep?
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.
got installed accidentally. weird.
coverage is not stopping. hmm |
@aarontravass there's a permission error for reading a file, please check your tests and make sure they don't reference any system files |
it's a problem even on master https://github.com/tinyhttp/logger/actions/runs/5100346720/jobs/9168579370 |
Let me take a look once again. |
ci passed :) |
As stated in #2 , this configuration will output logs to a file.