0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-30 22:34:10 -05:00

log 'new packages directory' message at a warn level

This commit is contained in:
Alex Kocharin 2013-10-26 16:20:42 +04:00
parent b2f6128e9c
commit 15d46e3280

View file

@ -2,6 +2,7 @@ var fs = require('fs')
, fsExt = require('fs-ext') , fsExt = require('fs-ext')
, Path = require('path') , Path = require('path')
, mystreams = require('./streams') , mystreams = require('./streams')
, Logger = require('./logger')
, FSError = require('./error').FSError , FSError = require('./error').FSError
function make_directories(dest, cb) { function make_directories(dest, cb) {
@ -159,9 +160,10 @@ function lock_and_read(name, callback) {
function Storage(path) { function Storage(path) {
this.path = path this.path = path
this.logger = Logger.logger.child({sub: 'fs'})
try { try {
fs.mkdirSync(path) fs.mkdirSync(path)
console.log('created new packages directory: ', path) this.logger.warn({path: path}, 'created new packages directory: @{path}')
} catch(err) { } catch(err) {
if (err.code !== 'EEXIST') throw new Error(err) if (err.code !== 'EEXIST') throw new Error(err)
} }