@atomist/skill-logging
Version:
Atomist Skill Logging API
96 lines (60 loc) • 2.49 kB
Markdown
Simple API to log into the Skill log stream.
This implementation will fall back to `console.log` for environments in which
Google Cloud Logging is not accessible.
To use the Skill Log create and use a `Logger` as follows:
```javascript
import { createLogger } from "@atomist/skill-logging";
const logger = createLogger({
correlationId: "correlationId from the incoming message",
workspaceId: "workspaceId of incoming message",
skillId: "skill.id of incoming message",
eventId: "eventId as passed into the skill via the Pub/Sub attributes",
});
// Send an debug message
logger.debug("My %s log message", "super");
// Close the logger instance to let it purge its internal queue
await logger.close();
```
Contributions to this project from community members are encouraged and
appreciated. Please review the [Contributing Guidelines](CONTRIBUTING.md) for
more information. Also see the [Development](
document.
This project is governed by the [Code of Conduct](CODE_OF_CONDUCT.md). You are
expected to act in accordance with this code by participating. Please report any
unacceptable behavior to code-of-conduct@atomist.com.
Please see [docs.atomist.com][atomist-doc] for developer documentation.
[]: https://docs.atomist.com/ "Atomist Documentation"
Follow [@atomist][atomist-twitter] and the [Atomist blog][atomist-blog].
[]: https://twitter.com/atomist "Atomist on Twitter"
[]: https://blog.atomist.com/ "The Atomist Blog"
General support questions should be discussed in the `
[][slack].
If you find a problem, please create an [issue][].
[]: https://github.com/atomist-skills/skill-logging/issues
You will need to install [Node.js][node] to build and test this project.
[]: https://nodejs.org/ "Node.js"
Install dependencies.
```
$ npm install
```
Use the `build` package script to compile, test, lint, and build the
documentation.
```
$ npm run build
```
Releases are handled via the Atomist Skills. Just push a release semantic
version tag to this repository.
---
Created by [Atomist][atomist]. Need Help? [Join our Slack workspace][slack].
[]: https://atomist.com/ "Atomist "
[]: https://join.atomist.com/ "Atomist Community Slack"