aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn'); is broken?
ajoslin103 opened this issue · comments
I'm submitting a bug report
in a fresh: au new sample
$cat aurelia.json
{
"name": "junk",
"type": "project:application",
"paths": {
"root": "src",
"resources": "resources",
"elements": "resources/elements",
"attributes": "resources/attributes",
"valueConverters": "resources/value-converters",
"bindingBehaviors": "resources/binding-behaviors"
},
"transpiler": {
"id": "babel",
"fileExtension": ".js"
},
"build": {
"options": {
"server": "dev",
"extractCss": "prod",
"coverage": false
}
},
"platform": {
"hmr": false,
"open": false,
"port": 8080,
"output": "dist"
},
"packageManager": "yarn"
}
- Library Version:
$ cat package.json
{
"name": "sample",
"description": "An Aurelia client application.",
"version": "0.1.0",
"repository": {
"type": "???",
"url": "???"
},
"license": "MIT",
"dependencies": {
"aurelia-bootstrapper": "^2.3.2",
"aurelia-animator-css": "^1.0.4"
},
"devDependencies": {
"aurelia-cli": "^1.0.0-beta.15",
"aurelia-testing": "^1.0.0",
"aurelia-tools": "^2.0.0",
"core-js": "^3.0.0",
"gulp": "^4.0.0",
"minimatch": "^3.0.4",
"through2": "^3.0.0",
"vinyl-fs": "^3.0.3",
"regenerator-runtime": "0.13.2",
"babel-eslint": "^10.0.1",
"eslint": "latest",
"babel-loader": "^8.0.5",
"babel-plugin-istanbul": "^5.1.1",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@babel/plugin-proposal-class-properties": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"@babel/core": "^7.4.0",
"@babel/register": "^7.4.0",
"gulp-rename": "^1.4.0",
"html-webpack-plugin": "^3.2.0",
"copy-webpack-plugin": "^5.0.0",
"mini-css-extract-plugin": "^0.4.3",
"aurelia-webpack-plugin": "^3.0.0",
"duplicate-package-checker-webpack-plugin": "^3.0.0",
"webpack": "^4.27.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.9",
"expose-loader": "^0.7.5",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"del": "^3.0.0",
"css-loader": "^1.0.0",
"file-loader": "^2.0.0",
"json-loader": "^0.5.7",
"html-loader": "^0.5.5",
"istanbul-instrumenter-loader": "^3.0.1",
"opn": "^5.4.0",
"webpack-bundle-analyzer": "^3.0.4"
},
"scripts": {
"build": "au build",
"start": "au run"
},
"engines": {
"node": ">=8.9.0"
}
}
Please tell us about your environment:
-
Operating System:
OSX 1014.4 -
Node Version:
$ node -v
v10.14.0
$ npm -v
6.7.0
-
Aurelia CLI OR JSPM OR Webpack AND Version
see above - -
Browser:
all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView -
Language:
all | TypeScript X.X | ESNext
Current behavior:
- au build sample (use the cli to build an app)
- expect to see debug messages written from app.js
$ cat app.js
import { LogManager } from 'aurelia-framework';
const Console = LogManager.getLogger('app');
export class App {
message = 'Hello World!';
attached() {
Console.info('info');
Console.warn('warn');
Console.error('error');
Console.debug('debug');
}
}
$ au run
(logged to the Google Chrome console)
INFO [aurelia] Aurelia Started
INFO [main] info
WARN [main] warn
ERROR [main] error
Expected/desired behavior:
debug messages to be written to the console
- What is the motivation / use case for changing the behavior?
utilizing debug messages while building an application can be helpful
@ajoslin103 can you help clarify what you were trying to do and it failed? It seems you tried to run au build test
? It doesn't look like the right command to run.
@ajoslin103 Calling .use.developmentLogging
will register a console appender, which gives you the log message in the browser console by default.
the method developmentLogging()
does not take any arguments, that's why it's normally guarded like this:
if (environment.debug) {
aurelia.use.developmentLogging();
}
tracked this down to the aurelia/logging-console library
closing this issue in favor of: aurelia/logging-console#18