You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			44 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Diff
		
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Diff
		
	
| diff --git a/node_modules/bunyan/lib/bunyan.js b/node_modules/bunyan/lib/bunyan.js
 | |
| index f988560..a4cf69a 100644
 | |
| --- a/node_modules/bunyan/lib/bunyan.js
 | |
| +++ b/node_modules/bunyan/lib/bunyan.js
 | |
| @@ -63,7 +63,7 @@ if (!runtimeEnv) {
 | |
|  }
 | |
| 
 | |
| 
 | |
| -var os, fs, dtrace;
 | |
| +var os, fs, pathModule, dtrace;
 | |
|  if (runtimeEnv === 'browser') {
 | |
|      os = {
 | |
|          hostname: function () {
 | |
| @@ -71,12 +71,15 @@ if (runtimeEnv === 'browser') {
 | |
|          }
 | |
|      };
 | |
|      fs = {};
 | |
| +    pathModule = {};
 | |
|      dtrace = null;
 | |
|  } else {
 | |
|      os = require('os');
 | |
|      fs = require('fs');
 | |
| +    pathModule = require('path');
 | |
|      try {
 | |
| -        dtrace = require('dtrace-provider' + '');
 | |
| +        throw new Error('dtrace-provider is not available')
 | |
| +        // dtrace = require('dtrace-provider' + '');
 | |
|      } catch (e) {
 | |
|          dtrace = null;
 | |
|      }
 | |
| @@ -1512,6 +1515,12 @@ RotatingFileStream.prototype.rotate = function rotate() {
 | |
|      }
 | |
| 
 | |
|      function finish() {
 | |
| +        if (!fs.existsSync(self.path)) {
 | |
| +            var dirPath = pathModule.dirname(self.path);
 | |
| +            if (!fs.existsSync(dirPath)) {
 | |
| +                fs.mkdirSync(dirPath, { recursive: true });
 | |
| +            }
 | |
| +        }
 | |
|          self._debug('  open %s', self.path);
 | |
|          self.stream = fs.createWriteStream(self.path,
 | |
|              {flags: 'a', encoding: 'utf8'});
 |