Skip to content

Commit

Permalink
chore: added ctx support in setupLogging()
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Feb 27, 2024
1 parent 937d2d7 commit be63384
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

*
* Added ctx support in `setupLogging()`

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions ts/logging.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { confP } from "yonius";
import util from "hive-js-util";
import util, { LoggingContext } from "hive-js-util";

const { Logging } = util;

export const setupLogging = async () => {
export const setupLogging = async (ctx?: LoggingContext) => {
const level = ((await confP("LEVEL", "DEBUG")) as string).toUpperCase();
const logstashUrl = (await confP(
"LOGSTASH_BASE_URL",
Expand All @@ -24,6 +24,6 @@ export const setupLogging = async () => {
}

if (logstashUrl && Logging.LogstashHandler.isReady(logstashUrl)) {
logger.addHandler(new Logging.LogstashHandler(logstashUrl));
logger.addHandler(new Logging.LogstashHandler(logstashUrl, ctx));
}
};

0 comments on commit be63384

Please sign in to comment.