import winston from 'winston';
import globals from '../globals';

const logger = new (winston.Logger)({
  levels: {
    trace: 9,
    input: 8,
    verbose: 7,
    prompt: 6,
    debug: 5,
    info: 4,
    data: 3,
    help: 2,
    warn: 1,
    error: 0,
  },
  colors: {
    trace: 'magenta',
    input: 'grey',
    verbose: 'cyan',
    prompt: 'grey',
    debug: 'blue',
    info: 'green',
    data: 'grey',
    help: 'cyan',
    warn: 'yellow',
    error: 'red',
  },
});

logger.add(winston.transports.Console, {
  level: 'trace',
  prettyPrint: true,
  colorize: true,
  silent: false,
  timestamp: false,
  label: globals.PROCESS_NAME,
});

logger.add(winston.transports.File, {
  prettyPrint: false,
  level: 'info',
  silent: false,
  colorize: true,
  timestamp: true,
  filename: './.framework.log',
  maxsize: 40000,
  maxFiles: 10,
  json: false,
});

export default logger;

@@ -62,61 +62,54 @@
 s';%0A
-%0Aconst logger = new (winston.Logger)(%7B%0A 
+import argv from '../argv';%0A%0Aconst
  levels
-:
+ =
  %7B%0A
-  
   tr
@@ -114,26 +114,24 @@
 trace: 9,%0A  
- 
- 
 input: 8,%0A  
@@ -128,18 +128,16 @@
 put: 8,%0A
-  
   verbos
@@ -140,26 +140,24 @@
 rbose: 7,%0A  
- 
- 
 prompt: 6,%0A 
@@ -155,18 +155,16 @@
 mpt: 6,%0A
-  
   debug:
@@ -167,18 +167,16 @@
 bug: 5,%0A
-  
   info: 
@@ -178,18 +178,16 @@
 nfo: 4,%0A
-  
   data: 
@@ -189,18 +189,16 @@
 ata: 3,%0A
-  
   help: 
@@ -198,26 +198,24 @@
  help: 2,%0A  
- 
- 
 warn: 1,%0A   
@@ -211,18 +211,16 @@
 arn: 1,%0A
-  
   error:
@@ -223,19 +223,375 @@
 ror: 0,%0A
-  %7D
+%7D;%0A%0Alet requestedLevel;%0Aif (typeof argv.verbose === 'string') %7B%0A  requestedLevel = argv.verbose.toLocaleLowerCase();%0A%7D else if (argv.verbose === true) %7B%0A  requestedLevel = 'debug';%0A%7D else %7B%0A  requestedLevel = 'info';%0A%7D%0A%0Aconst actualLevel = Object.keys(levels).includes(requestedLevel) ? requestedLevel : 'info';%0A%0Aconst logger = new (winston.Logger)(%7B%0A  levels
 ,%0A  colo
@@ -851,21 +851,20 @@
 level: '
-trace
+info
 ',%0A  pre
@@ -1035,30 +1035,35 @@
 e,%0A  level: 
-'info'
+actualLevel
 ,%0A  silent: 
@@ -1192,16 +1192,220 @@
 e,%0A%7D);%0A%0A
+if (actualLevel !== requestedLevel) %7B%0A  logger.warn(%60Invalid verbosity value $%7BJSON.stringify(requestedLevel)%7D, must be one of %22$%7BObject.keys(levels).join('%22, %22')%7D%22. Using %22$%7BactualLevel%7D%22 instead.%60);%0A%7D%0A%0A
 export d

Add —verbose={LEVEL|boolean} option