lupu60 / nestjs-toolbox Goto Github PK
View Code? Open in Web Editor NEWThe repository contains a suite of components and modules for Nest.js
Home Page: https://lupu60.github.io/nestjs-toolbox/
License: MIT License
The repository contains a suite of components and modules for Nest.js
Home Page: https://lupu60.github.io/nestjs-toolbox/
License: MIT License
I'm submitting a ...
[ ] bug report
[x] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
need reformat timestamp in log output
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
@UpdateDateColumn()
public updatedAt!: Date;
await TypeOrmUpsert.upsert(English, [{ path: 'foo', phrase: 'hi'}], 'path');
Expected behavior
The "updatedAt" column should update.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
"@nest-toolbox/typeorm-upsert": "^1.4.2",
Smartphone (please complete the following information):
not applicable
Additional context
not applicable
Right now only node 14 is supported. Can Node 12 be used in addition?
yarn
...
error @nest-toolbox/[email protected]: The engine "node" is incompatible with this module. Expected version "14". Got "12.22.3"
Setting the 'color' property to false on the formatterOptions has no effect. BunyanLoggerService should use the property, instead its hard coded to color the error and warn messages with red and yello
Looking to use the BunyanLogger in this context: https://docs.nestjs.com/techniques/logger#injecting-a-custom-logger
Where I can do setContext
, which seems to be provided by the built in Logger
. Could the BunyanLogger extend that to provide this, or is it more involved?
Looks like BunyanLogger takes a context as the second param to log
, but in a class scenario it's tedious to have to set that every time in the class.
return Promise<T[]|T>;
on TypeOrmUpsert
Is your feature request related to a problem? Please describe.
When performing upsert I would like to know which entity that updated or inserted.
Describe the solution you'd like
return the status (inserted or updated)
Is your feature request related to a problem? Please describe.
Is there a way to simply limit the size of the logged message ?
Describe the solution you'd like
Providing an option like maxLength
, that would handle string slicing.
Describe the bug
When using Seq logging (I am using the package bunyan-seq to create a custom stream) The string interpolation / variable substitution does not work
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When logging with the following statement:
this.logger.warn('{user} tried access the {service} service with an expired key!',{ user: 'E73882', service: 'PurchaseOrder'});
the output in the log should be
E73882 tried access the PurchaseOrder service with an expired key!
Screenshots
What happens is:
Additional context
Here is my main.ts:
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
const seq = require('bunyan-seq');
async function bootstrap() {
const app = await NestFactory.create(AppModule,{
bufferLogs: true,
});
app.useLogger(new BunyanLoggerService({
projectId: 'NestJS-Microservice',
formatterOptions: {
outputMode: 'json',
},
customStreams:[seq.createStream({serverUrl: 'http://localhost:5341', apiKey: '123456789'})] ,
extraFields: {
app: 'extra-field-app',
sample: 'extra-field-sample'
}
}));
await app.listen(3000);
}
bootstrap();`
In the controller in just create a Logger instance as follows and uses it:
`private readonly logger = new Logger('AppController');`
Examples:
`this.logger.warn('English hello {lang}',{ lang: 'en' }); `
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.