Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: SAP/ui5-logger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0
Choose a base ref
...
head repository: SAP/ui5-logger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.1
Choose a head ref
  • 17 commits
  • 8 files changed
  • 3 contributors

Commits on Jan 11, 2019

  1. Copy the full SHA
    2e2ed0b View commit details

Commits on Jan 23, 2019

  1. Copy the full SHA
    2fbeb1b View commit details
  2. Copy the full SHA
    7d175e4 View commit details

Commits on Feb 4, 2019

  1. Copy the full SHA
    5565e75 View commit details

Commits on Feb 5, 2019

  1. Copy the full SHA
    dfb32fd View commit details

Commits on Feb 8, 2019

  1. [Security] Bump lodash from 4.17.5 to 4.17.11

    Bumps [lodash](https://github.com/lodash/lodash) from 4.17.5 to 4.17.11. **This update includes security fixes.**
    - [Release notes](https://github.com/lodash/lodash/releases)
    - [Changelog](https://github.com/lodash/lodash/blob/master/CHANGELOG)
    - [Commits](lodash/lodash@4.17.5...4.17.11)
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot-support authored and RandomByte committed Feb 8, 2019
    Copy the full SHA
    9b23b8e View commit details

Commits on Feb 14, 2019

  1. [Security] Bump handlebars from 4.0.12 to 4.1.0

    Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.0.12 to 4.1.0. **This update includes security fixes.**
    - [Release notes](https://github.com/wycats/handlebars.js/releases)
    - [Changelog](https://github.com/wycats/handlebars.js/blob/v4.1.0/release-notes.md)
    - [Commits](handlebars-lang/handlebars.js@v4.0.12...v4.1.0)
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot-support authored and matz3 committed Feb 14, 2019
    Copy the full SHA
    6c5de05 View commit details

Commits on Feb 15, 2019

  1. Copy the full SHA
    d9b7f97 View commit details

Commits on Feb 19, 2019

  1. Copy the full SHA
    4795b70 View commit details
  2. Copy the full SHA
    7683aad View commit details
  3. Copy the full SHA
    fc9b1e9 View commit details

Commits on Mar 5, 2019

  1. Copy the full SHA
    ef9c69b View commit details
  2. Copy the full SHA
    108872a View commit details
  3. Copy the full SHA
    74e10a5 View commit details

Commits on Mar 6, 2019

  1. Copy the full SHA
    8f65d3f View commit details

Commits on Mar 21, 2019

  1. 3
    Copy the full SHA
    81cd803 View commit details
  2. Release 1.0.1

    RandomByte committed Mar 21, 2019
    Copy the full SHA
    fd6c190 View commit details
Showing with 6,683 additions and 6,783 deletions.
  1. +10 −4 .github/ISSUE_TEMPLATE.md
  2. +5 −1 CHANGELOG.md
  3. +2 −2 CONTRIBUTING.md
  4. +4 −2 README.md
  5. +4 −4 jsdoc.json
  6. +14 −2 lib/logger.js
  7. +6,626 −6,750 package-lock.json
  8. +18 −18 package.json
14 changes: 10 additions & 4 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
Hey there 👋 Please have a look at our guidelines on reporting issues:
https://github.com/SAP/ui5-tooling/blob/master/CONTRIBUTING.md#-reporting-issues
-->

## Expected Behavior
{...}

@@ -13,17 +18,18 @@
- UI5 Module Version *(output of `ui5 --version` when using the CLI)*: `{...}`
- Node.js Version: `{...}`
- npm Version: `{...}`
- OS/Platform: {...}
- Browser *(if relevant)*: {...}
- Other information: {...}
- OS/Platform: `{...}`
- Browser *(if relevant)*: `{...}`
- Other information: `{...}`

## Affected components *(if known)*
<!-- Check affected components by writing an "X" into the brackets -->
- [ ] [ui5-builder](https://github.com/SAP/ui5-builder)
- [ ] [ui5-server](https://github.com/SAP/ui5-server)
- [ ] [ui5-cli](https://github.com/SAP/ui5-cli)
- [ ] [ui5-fs](https://github.com/SAP/ui5-fs)
- [ ] [ui5-project](https://github.com/SAP/ui5-project)
- [ ] [ui5-logger](https://github.com/SAP/ui5-logger)
- [X] [ui5-logger](https://github.com/SAP/ui5-logger)

## Log Output / Stack Trace
```
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

A list of unreleased changes can be found [here](https://github.com/SAP/ui5-logger/compare/v1.0.0...HEAD).
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-logger/compare/v1.0.1...HEAD).

<a name="v1.0.1"></a>
## [v1.0.1] - 2019-03-13

<a name="v1.0.0"></a>
## [v1.0.0] - 2019-01-09
@@ -25,6 +28,7 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-logg
<a name="v0.0.1"></a>
## v0.0.1 - 2018-06-06

[v1.0.1]: https://github.com/SAP/ui5-logger/compare/v1.0.0...v1.0.1
[v1.0.0]: https://github.com/SAP/ui5-logger/compare/v0.2.2...v1.0.0
[v0.2.2]: https://github.com/SAP/ui5-logger/compare/v0.2.1...v0.2.2
[v0.2.1]: https://github.com/SAP/ui5-logger/compare/v0.2.0...v0.2.1
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Contributing to the UI5 Build and Development Tooling
# Contributing to the UI5 Tooling

See CONTRIBUTING.md in the [SAP/ui5-tooling](https://github.com/SAP/ui5-tooling/blob/master/CONTRIBUTING.md) repository.
See CONTRIBUTING.md in the [SAP/ui5-tooling](https://github.com/SAP/ui5-tooling/blob/master/CONTRIBUTING.md) repository.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,15 +2,17 @@

# ui5-logger
> Internal logging module
> Part of the [UI5 Build and Development Tooling](https://github.com/SAP/ui5-tooling)
> Part of the [UI5 Tooling](https://github.com/SAP/ui5-tooling)
[![Travis CI Build Status](https://travis-ci.org/SAP/ui5-logger.svg?branch=master)](https://travis-ci.org/SAP/ui5-logger)
[![npm Package Version](https://badge.fury.io/js/%40ui5%2Flogger.svg)](https://www.npmjs.com/package/@ui5/logger)
[![Dependency Status](https://david-dm.org/SAP/ui5-logger/master.svg)](https://david-dm.org/SAP/ui5-logger/master)
[![devDependency Status](https://david-dm.org/SAP/ui5-logger/master/dev-status.svg)](https://david-dm.org/SAP/ui5-logger/master#info=devDependencies)

**⌨️ CLI reference can be found [here!](https://github.com/SAP/ui5-cli#cli-usage)**

## Logger
Used for logging purposes across the UI5 Build and Development Tooling and plugins. Features log levels and progress logging. Basically, it is a wrapper of [npmlog](https://github.com/npm/npmlog).
Used for logging purposes across the UI5 Tooling and plugins. Features log levels and progress logging. Basically, it is a wrapper of [npmlog](https://github.com/npm/npmlog).

## Contributing
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-tooling/blob/master/CONTRIBUTING.md).
8 changes: 4 additions & 4 deletions jsdoc.json
Original file line number Diff line number Diff line change
@@ -24,10 +24,10 @@
}
},
"openGraph": {
"title": "UI5 Build and Development Tooling - API Reference",
"title": "UI5 Tooling - API Reference",
"type": "website",
"image": "https://sap.github.io/ui5-tooling/docs/images/UI5_logo_wide.png",
"site_name": "UI5 Build and Development Tooling - API Reference",
"site_name": "UI5 Tooling - API Reference",
"url": "https://sap.github.io/ui5-tooling/"
},
"docdash": {
@@ -42,8 +42,8 @@
"Interfaces"
],
"meta": {
"title": "UI5 Build and Development Tooling - API Reference - UI5 Logger",
"description": "UI5 Build and Development Tooling - API Reference - UI5 Logger",
"title": "UI5 Tooling - API Reference - UI5 Logger",
"description": "UI5 Tooling - API Reference - UI5 Logger",
"keyword": "openui5 sapui5 ui5 build development tool api reference"
},
"search": true,
16 changes: 14 additions & 2 deletions lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const npmlog = require("npmlog");

const levels = ["silly", "verbose", "info", "warn", "error"];
if (process.env.UI5_LOG_LVL) {
const levels = ["silly", "verbose", "info", "warn", "error"];
const logLvl = process.env.UI5_LOG_LVL;
if (!levels.includes(logLvl)) {
throw new Error(`UI5 Logger: Environment variable UI5_LOG_LVL is set to an unkown log level "${logLvl}". ` +
@@ -25,7 +25,19 @@ class Logger {
}

isLevelEnabled(levelName) {
return true;
const currIdx = levels.indexOf(npmlog.level);
const reqIdx = levels.indexOf(levelName);
if (currIdx === -1) {
throw new Error(`Failed to find current log level ${npmlog.level} in list of expected log levels`);
}
if (reqIdx === -1) {
throw new Error(`Unkown log level "${levelName}"`);
}
if (reqIdx >= currIdx) {
return true;
} else {
return false;
}
}

silly(...messages) {
Loading