Update logger settings
This commit is contained in:
parent
b9a32354ce
commit
62dec16667
|
|
@ -1,17 +1,16 @@
|
|||
'use strict'
|
||||
const path = require('path')
|
||||
const config = require('../config')
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const config = require('../config');
|
||||
|
||||
const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
||||
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
||||
|
||||
const {isDev, styleRule, assetsPath} = require('./utils');
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
return path.join(__dirname, '..', dir);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const createLintingRule = () => ({
|
||||
test: /\.(js|vue)$/,
|
||||
loader: 'eslint-loader',
|
||||
|
|
@ -19,9 +18,9 @@ const createLintingRule = () => ({
|
|||
include: [resolve('src'), resolve('test')],
|
||||
options: {
|
||||
formatter: require('eslint-friendly-formatter'),
|
||||
emitWarning: !config.dev.showEslintErrorsInOverlay
|
||||
}
|
||||
})
|
||||
emitWarning: !config.dev.showEslintErrorsInOverlay,
|
||||
},
|
||||
});
|
||||
|
||||
//todo: mini-css-extract-plugin? upgrade to webpack 4, then use this
|
||||
//https://github.com/webpack-contrib/mini-css-extract-plugin
|
||||
|
|
@ -29,21 +28,21 @@ const createLintingRule = () => ({
|
|||
module.exports = {
|
||||
context: path.resolve(__dirname, '../'),
|
||||
entry: {
|
||||
app: './src/main.js'
|
||||
app: './src/main.js',
|
||||
},
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: '[name].js',
|
||||
publicPath: isDev
|
||||
? config.dev.assetsPublicPath
|
||||
: config.build.assetsPublicPath
|
||||
: config.build.assetsPublicPath,
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.vue', '.json', '.gql', '.graphql', '.scss'],
|
||||
alias: {
|
||||
'@': resolve('src'),
|
||||
styles: resolve('src/styles')
|
||||
}
|
||||
styles: resolve('src/styles'),
|
||||
},
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
|
@ -56,53 +55,60 @@ module.exports = {
|
|||
video: ['src', 'poster'],
|
||||
source: 'src',
|
||||
img: 'src',
|
||||
image: 'xlink:href'
|
||||
}
|
||||
}
|
||||
image: 'xlink:href',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env']
|
||||
presets: ['@babel/preset-env'],
|
||||
},
|
||||
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
|
||||
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')],
|
||||
},
|
||||
{
|
||||
test: /\.(gql|graphql)$/,
|
||||
loader: 'graphql-tag/loader',
|
||||
exclude: /node_modules/
|
||||
use: [
|
||||
{
|
||||
loader: 'webpack-graphql-loader',
|
||||
options: {
|
||||
output: 'document',
|
||||
},
|
||||
},
|
||||
],
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: assetsPath('img/[name].[hash:7].[ext]')
|
||||
}
|
||||
name: assetsPath('img/[name].[hash:7].[ext]'),
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: assetsPath('media/[name].[hash:7].[ext]')
|
||||
}
|
||||
name: assetsPath('media/[name].[hash:7].[ext]'),
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: assetsPath('fonts/[name].[hash:7].[ext]')
|
||||
}
|
||||
name: assetsPath('fonts/[name].[hash:7].[ext]'),
|
||||
},
|
||||
},
|
||||
styleRule(false), // css rule
|
||||
styleRule(true) // sass rule
|
||||
]
|
||||
styleRule(true), // sass rule
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new VueLoaderPlugin()
|
||||
new VueLoaderPlugin(),
|
||||
],
|
||||
node: {
|
||||
// prevent webpack from injecting useless setImmediate polyfill because Vue
|
||||
|
|
@ -114,6 +120,6 @@ module.exports = {
|
|||
fs: 'empty',
|
||||
net: 'empty',
|
||||
tls: 'empty',
|
||||
child_process: 'empty'
|
||||
}
|
||||
}
|
||||
child_process: 'empty',
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
import logging
|
||||
|
||||
|
||||
def get_logger(name):
|
||||
return logging.getLogger(f'skillbox.{name}')
|
||||
|
|
@ -290,6 +290,9 @@ LOGGING = {
|
|||
'simple_format': {
|
||||
'format': '%(levelname)s %(name)s: %(message)s'
|
||||
},
|
||||
'debug_format': {
|
||||
'format': '__debug__ %(levelname)s %(name)s: %(message)s'
|
||||
}
|
||||
},
|
||||
'disable_existing_loggers': True,
|
||||
'handlers': {
|
||||
|
|
@ -300,20 +303,37 @@ LOGGING = {
|
|||
'console': {
|
||||
'level': 'INFO',
|
||||
'class': 'logging.StreamHandler',
|
||||
'stream': sys.stdout,
|
||||
'formatter': 'simple_format'
|
||||
},
|
||||
'debug_console': {
|
||||
'level': 'DEBUG',
|
||||
'class': 'logging.StreamHandler',
|
||||
'formatter': 'debug_format'
|
||||
}
|
||||
},
|
||||
'loggers': {
|
||||
'': {
|
||||
'handlers': ['console'],
|
||||
'level': 'INFO',
|
||||
'propagate': True,
|
||||
'level': 'WARNING'
|
||||
},
|
||||
'django.security.DisallowedHost': {
|
||||
'handlers': ['mail_admins'],
|
||||
'level': 'CRITICAL',
|
||||
'propagate': False,
|
||||
'skillbox': {
|
||||
'handlers': ['console'],
|
||||
'level': 'INFO',
|
||||
'propagate': False
|
||||
},
|
||||
'graphql': {
|
||||
'handlers': ['console'],
|
||||
'level': 'WARNING',
|
||||
'propagate': False
|
||||
},
|
||||
'django': {
|
||||
'handlers': ['console'],
|
||||
'level': 'WARNING'
|
||||
},
|
||||
'django.server': {
|
||||
'handlers': ['console'],
|
||||
'level': 'WARNING',
|
||||
'propagate': True,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -400,7 +420,6 @@ TASKBASE_SUPERPASSWORD = os.environ.get("TASKBASE_SUPERPASSWORD")
|
|||
TASKBASE_BASEURL = os.environ.get("TASKBASE_BASEURL")
|
||||
ENABLE_SPELLCHECK = True if TASKBASE_BASEURL else False
|
||||
|
||||
|
||||
TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
|
||||
TEST_OUTPUT_DIR = './test-reports/'
|
||||
TEST_OUTPUT_VERBOSE = 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue