Skip to content

Commit

Permalink
fix: TECH regenerate yarn.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-taran committed Jan 31, 2024
1 parent 72d1027 commit ac1a01e
Show file tree
Hide file tree
Showing 5 changed files with 1,786 additions and 1,931 deletions.
2 changes: 1 addition & 1 deletion packages/gcloud-express-logger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface IGcloudLogger {
error: (message: string, payload?: unknown) => void
}

export const requestLogger = (logger: IGcloudLogger) => (req: Request, res: Response, next: NextFunction) => {
export const requestLogger = (logger: IGcloudLogger) => (req: Request, res: Response, next: NextFunction): void => {
const startTime = process.hrtime()

const logRequest = () => {
Expand Down
20 changes: 10 additions & 10 deletions packages/gcloud-logger/src/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,47 +77,47 @@ export class Logger {
this.logLevelNumber = logLevel(logLevelStarts)
}

public debug(message: string, payload?: unknown) {
public debug(message: string, payload?: unknown): void {
this.log(Level.DEBUG, message, payload)
}

public info(message: string, payload?: unknown) {
public info(message: string, payload?: unknown): void {
this.log(Level.INFO, message, payload)
}

public notice(message: string, payload?: unknown) {
public notice(message: string, payload?: unknown): void {
this.log(Level.NOTICE, message, payload)
}

public warn(message: string, payload?: unknown) {
public warn(message: string, payload?: unknown): void {
this.log(Level.WARNING, message, payload)
}

public error(message: string, payload?: unknown) {
public error(message: string, payload?: unknown): void {
this.log(Level.ERROR, message, payload)
}

public crit(message: string, payload?: unknown) {
public crit(message: string, payload?: unknown): void {
this.log(Level.CRITICAL, message, payload)
}

public alert(message: string, payload?: unknown) {
public alert(message: string, payload?: unknown): void {
this.log(Level.ALERT, message, payload)
}

public emerg(message: string, payload?: unknown) {
public emerg(message: string, payload?: unknown): void {
this.log(Level.EMERGENCY, message, payload)
}

public log(level: Level | Level.DEFAULT, messageText: string, payload?: unknown) {
public log(level: Level | Level.DEFAULT, messageText: string, payload?: unknown): void {
if (LevelNumber[level] < this.logLevelNumber) {
return
}

this.print(level, this.formatMessage(level, messageText, payload))
}

public reportError(err: unknown) {
public reportError(err: unknown): void {
this.error(this.getMessage(err), err)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/gcloud-logger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export const logger = new Logger(
parseInt(process.env['LOG_MAX_FIELD_LENGTH'] ?? DEFAULT_MAX_LENGTH, 10),
)

export const reportError = (e: unknown) => {
export const reportError = (e: unknown): void => {
logger.reportError(e)
}
13 changes: 7 additions & 6 deletions packages/gcloud-typeorm-logger/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
export interface IGcloudLogger {
debug: (message: string, payload?: unknown) => void
info: (message: string, payload?: unknown) => void
Expand All @@ -10,7 +11,7 @@ export class SqlLogger {
this.logQueries = logQueries
}

public logQuery(query: string, parameters?: any[], _?: any) {
public logQuery(query: string, parameters?: any[], _?: never): void {
if (!this.logQueries) {
return
}
Expand All @@ -22,23 +23,23 @@ export class SqlLogger {
}
}

public logQueryError(error: string, query: string, parameters?: any[], _?: any) {
public logQueryError(error: string, query: string, parameters?: any[], _?: never): void {
this.logger.error(`query failed: ${query}`, { error, parameters })
}

public logQuerySlow(queryTime: number, query: string, parameters?: any[], _?: any) {
public logQuerySlow(queryTime: number, query: string, parameters?: any[], _?: never): void {
this.logger.warn(`query is slow: ${query}`, { queryTime, parameters })
}

public logSchemaBuild(message: string, _?: any) {
public logSchemaBuild(message: string, _?: never): void {
this.logger.info(message)
}

public logMigration(message: string, _?: any) {
public logMigration(message: string, _?: never): void {
this.logger.info(message)
}

public log(level: 'log' | 'info' | 'warn', message: any, _?: any) {
public log(level: 'log' | 'info' | 'warn', message: any, _?: never): void {
switch (level) {
case 'log':
this.logger.debug(message)
Expand Down
Loading

0 comments on commit ac1a01e

Please sign in to comment.