code-server/packages/logger
Kyle Carberry 05899b5edf
Create initial server layout (#11)
* Create initial server layout

* Adjust command name to entry

* Add @oclif/config as dependency

* Implement build process for outputting single binary

* Add init message

* Remove unused import, add tsconfig.json to .gitignore

* Accidently pushed wacky change to output host FS files

* Add options to createApp
2019-02-05 11:15:49 -06:00
..
src Create initial server layout (#11) 2019-02-05 11:15:49 -06:00
package.json not finished 2019-02-05 11:15:42 -06:00
README.md not finished 2019-02-05 11:15:42 -06:00
yarn.lock not finished 2019-02-05 11:15:42 -06:00

Logger

Beautiful client logging inspired by https://github.com/uber-go/zap.

Example Usage

import { field, logger } from "@coder/logger";

logger.info("Loading container",
	field("container_id", container.id_str),
	field("organization_id", organization.id_str));

Formatting

By default the logger uses a different formatter depending on whether it detects it is running in the browser or not. A custom formatter can be set:

import { logger, Formatter } from "@coder/logger";

class MyFormatter extends Formatter {
	// implementation ...
}

logger.formatter = new MyFormatter();