Skip to content

Commit

Permalink
[INTERNAL] Implement ui5-logger enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomByte committed Jan 19, 2023
1 parent 5bf29bc commit 7cbcee7
Show file tree
Hide file tree
Showing 4 changed files with 302 additions and 8,186 deletions.
10 changes: 7 additions & 3 deletions lib/cli/middlewares/logger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import logger from "@ui5/logger";
import ConsoleWriter from "@ui5/logger/writers/Console";
import {getVersion} from "../version.js";
/**
* Logger middleware used as one of default middlewares by tooling
Expand All @@ -7,9 +8,12 @@ import {getVersion} from "../version.js";
* @returns {object} logger instance or null
*/
export async function initLogger(argv) {
if (!argv.verbose && !argv.loglevel) return null;
ConsoleWriter.init();

if (!argv.verbose && !argv.loglevel) {
return null;
}

const {default: logger} = await import("@ui5/logger");
if (argv.loglevel) {
logger.setLevel(argv.loglevel);
}
Expand Down
Loading

0 comments on commit 7cbcee7

Please sign in to comment.