Giter VIP home page Giter VIP logo

logardian's Introduction

About

Hi there. My name is Tema. I'm a Backend Blockchain Developer. Love to learn new things, and try to share them to everyone.

Skills

  • NodeJS, Nx, NestJS, TypeScript, TypeORM, Prisma
  • GraphQL, RestAPI, gRPC
  • NATS, RabbitMQ
  • Linux, Docker, Gitlab CI/CD, Ansible, Terraform
  • Grafana, Loki, Prometheus
  • Bitcoin, Litecoin, Dogecoin, Ethereum, Tron, Polkadot, EOS, Avalanche
  • Solidity, GP Subgraphs, Web3, Ethers.js, Hardhat

Projects

  • Creator of Volt. Open-source task management app
  • Create packages in @shelf

logardian's People

Contributors

semantic-release-bot avatar temarusanov avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

logardian's Issues

object with type "Error" do not logs in console

try {
      throw new Error()
} catch (error) {
      console.log(error) // logs error
      this._logger.error(`Failed`, error) // dont logs
}

try {
      throw new NotFoundException()
} catch (error) {
      this._logger.error(`Failed`, error) // works
}

But it's working with NestJS Exceptions

Readme.MD

  1. Описание основных методов warn, verbose, log, error и т.д. с описанием кейсов, где они должны использоваться
  2. Варианты создания лейблов и layer'ов. Как с ними работать, зачем нужно это разделение
  3. Если есть всякие нетривиальные проблемы/механизмы поведения, о которых ты знаешь, нужно добавить описание решения проблем с ними => в либе rabbitmq должен быть логгер по сути и так - если его нет, то как туда добавить и как работать с этим логгером в самом проекте
  4. Как скрывать трейс в логах?
  5. зависимости залочить все, посмотреть текущую сборку в package-lock.json и залочить зависимости под последние рабочие
  6. логи совместимы с pm2? как будет происходить разделение на error/debug/log?
  7. либа не скомпиленная лежит, при установке её придётся компилить?
  8. есть стандарт разделения на layer/labels/level? Именование label'ов?

If object is string, logger does not log it

try {
} catch (error) {
      console.log(error)
      this._logger.error(`Snapshots creation failed`, error)
}

Result:

[2021-09-30 08:36:46.183] error: Snapshots creation failed
caller -> CreateSnapshotsFeature.createSnapshots
path -> /home/tema/Documents/GitHub/evr-core/src/namespaces/system/features/create-snapshots.feature.ts:121:26

Logardian config way

At the moment, the logger takes settings directly from the .env file. I'm not sure how convenient it will be on some projects that do not want to configure the logger via .env.

LOGARDIAN_LABELS=* # In this project: events,payments,transactions
LOGARDIAN_TRACE=false
LOGARDIAN_JSON=false

I have an idea to configure the logger through code

import { Logardian } from 'logardian'

Logardian.config({
    labels: ['database', 'payments' ],
    trace: false,
    json: true,
})

const logger = new Logardian()

Which seems to be the best way?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.