build
This commit is contained in:
parent
b5f932ab33
commit
92ffd22f79
6 changed files with 7 additions and 7 deletions
2
dist/logger.d.ts
vendored
2
dist/logger.d.ts
vendored
|
|
@ -3,7 +3,7 @@ interface LogOptions {
|
|||
conta?: string;
|
||||
usuario?: string;
|
||||
detalhes?: unknown[];
|
||||
eProdicao: boolean;
|
||||
eProducao: boolean;
|
||||
}
|
||||
export declare const logger: {
|
||||
/** 🟢 Informação geral */
|
||||
|
|
|
|||
2
dist/logger.js
vendored
2
dist/logger.js
vendored
|
|
@ -9,7 +9,7 @@ const LOKI_BASE_URL = "https://log.idz.one";
|
|||
const LOKI_ENDPOINT = "/loki/api/v1/push";
|
||||
const createLogger = (level) => {
|
||||
const sendToLoki = async (mensagem, options) => {
|
||||
if (!options.eProdicao) {
|
||||
if (!options.eProducao) {
|
||||
console.log(level, mensagem, options);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
2
dist/teste.js
vendored
2
dist/teste.js
vendored
|
|
@ -1,5 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const logger_1 = require("./logger");
|
||||
logger_1.logger.error("Esse é um erro", { app: "teste", eProdicao: true });
|
||||
logger_1.logger.error("Esse é um erro", { app: "teste", eProducao: true });
|
||||
//# sourceMappingURL=teste.js.map
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "p-comuns",
|
||||
"version": "0.73.0",
|
||||
"version": "0.75.0",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ interface LogOptions {
|
|||
conta?: string
|
||||
usuario?: string
|
||||
detalhes?: unknown[]
|
||||
eProdicao: boolean
|
||||
eProducao: boolean
|
||||
}
|
||||
|
||||
interface LokiStream {
|
||||
|
|
@ -25,7 +25,7 @@ interface LokiStream {
|
|||
|
||||
const createLogger = (level: LogLevel) => {
|
||||
const sendToLoki = async (mensagem: string, options: LogOptions) => {
|
||||
if (!options.eProdicao) {
|
||||
if (!options.eProducao) {
|
||||
console.log(level, mensagem, options)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import { logger } from "./logger"
|
||||
|
||||
logger.error("Esse é um erro", { app: "teste", eProdicao: true })
|
||||
logger.error("Esse é um erro", { app: "teste", eProducao: true })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue