melhoria de tipagem
This commit is contained in:
parent
25b760a2ff
commit
1ac82cb863
5 changed files with 24 additions and 21 deletions
|
|
@ -51,22 +51,24 @@ type tipoLog = {
|
|||
parametros?: { [k: string]: string }
|
||||
}
|
||||
|
||||
export const logger =
|
||||
({
|
||||
app: app_e,
|
||||
eProducao,
|
||||
parametros: parametrosAmbiente,
|
||||
}: {
|
||||
app: string
|
||||
eProducao: boolean
|
||||
parametros?: { [k: string]: string }
|
||||
}) =>
|
||||
({ inquilino, usuario, parametros: parametrosSessao }: tipoOpSessao) =>
|
||||
async (
|
||||
level: tipoLevel,
|
||||
mensagem: string,
|
||||
op_tipoLog?: tipoLog,
|
||||
): Promise<[objeto: tipoLokiObjeto, erro?: string]> => {
|
||||
type tipoLogger = (amb: {
|
||||
app: string
|
||||
eProducao: boolean
|
||||
parametros?: {
|
||||
[k: string]: string
|
||||
}
|
||||
}) => (
|
||||
sess: tipoOpSessao,
|
||||
) => (
|
||||
level: tipoLevel,
|
||||
mensagem: string,
|
||||
op_tipoLog?: tipoLog,
|
||||
) => Promise<[objeto: tipoLokiObjeto, erro?: string]>
|
||||
|
||||
export const logger: tipoLogger =
|
||||
({ app: app_e, eProducao, parametros: parametrosAmbiente }) =>
|
||||
({ inquilino, usuario, parametros: parametrosSessao }) =>
|
||||
async (level, mensagem, op_tipoLog) => {
|
||||
let {
|
||||
__filename,
|
||||
detalhes,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue