kibana/packages/kbn-some-dev-log
Spencer 4f817ad8a0
[kbn/pm] rewrite to avoid needing a build process (#136207)
* [kbn/pm] rewrite to avoid needing a build process

* uncomment timing reporting

* throw in a few missing comments

* Update README.md

* remove extra SomeDevLog interface from ci-stats-core

* remove non-stdio logging from bazel_runner, improve output formatting

* use private fields instead of just ts private props

* promote args to a positional arg

* optionally require the ci-stats-reporter after each command

* allow opt-ing out of vscode config management

* reduce to a single import

* add bit of docs regarding weird imports and package deps of kbn/pm

* clean extraDirs from Kibana's package.json file too

* tweak logging of run-in-packages to use --quiet and not just CI=true

* remove unlazy-loader

* add readme for @kbn/yarn-lock-validator

* convert @kbn/some-dev-logs docs to mdx

* remove missing navigation id and fix id in dev-cli-runner docs

* fix title of some-dev-logs docs page

* typo
2022-07-18 08:46:13 -07:00
..
src [kbn/pm] rewrite to avoid needing a build process (#136207) 2022-07-18 08:46:13 -07:00
BUILD.bazel [kbn/pm] rewrite to avoid needing a build process (#136207) 2022-07-18 08:46:13 -07:00
jest.config.js [kbn/pm] rewrite to avoid needing a build process (#136207) 2022-07-18 08:46:13 -07:00
package.json [kbn/pm] rewrite to avoid needing a build process (#136207) 2022-07-18 08:46:13 -07:00
README.mdx [kbn/pm] rewrite to avoid needing a build process (#136207) 2022-07-18 08:46:13 -07:00
tsconfig.json [kbn/pm] rewrite to avoid needing a build process (#136207) 2022-07-18 08:46:13 -07:00

---
id: kibDevDocsOpsSomeDevLog
slug: /kibana-dev-docs/ops/kbn-some-dev-log
title: "@kbn/some-dev-log"
description: 'LCD types for several dev-focused loggers'
date: 2022-07-14
tags: ['kibana', 'dev', 'contributor', 'operations', 'packages', 'scripts', 'logging']
---

`@kbn/some-dev-log` implements lowest-common denominator types for several loggers that we use in development tooling. In order for commonly used tools to accept either log instance we need a common interface for them to implement which gives enough functionality to get the job done but doesn't require implementing a bunch of fancy features in all loggers.

The interface mostly follows the `console.log()` interface, allowing you to pass a string as the first argument and then anything afterwards. The arguments are converted to a string by all loggers using [`util.format()`](https://nodejs.org/api/util.html#utilformatformat-args) from the standard library.

Currently, the loggers implementing this type are:

 - <DocLink id="kibDevDocsToolingLog" />: The majority of dev tasks should use this log and it is automatically provided by the common dev-task wrapper provided by <DocLink id="kibDevDocsOpsDevCliRunner" />.
 - <DocLink id="kibDevDocsOpsKbnPm"/> `Log` class: `@kbn/pm` runs before the repository is bootstrapped and needs a logger to use before other packages are available, so we have a separate and simple log implementation that code which implements the `SomeDevLog` class. Other code in the repository should rarely need to use this class or even know of it's existance.

Unless your package needs to be used by `@kbn/pm` there is little reason you should need to use this type, but it might be a good idea to use this type if there's a chance we might need to use your package in the future.