lib/rotatedlogger.js
function write(s) {
		var err
		var args = Array.prototype.slice.call(arguments)
		var cb = typeof args[args.length - 1] === 'function' ? args.pop() : null
		var cbCounter = 1
		if (writeToStdoutEnabled) {
			cbCounter++
			process.stdout.write(s, stdWr)
		}
		if (writeStream) {
			cbCounter++
			writeStream.write(s, wRes)
		}
		end()

		function stdWr(e) {
			if (e) {
				if (!err) err = e
				writeToStdoutEnabled = false
				write('stdout error: ' + e.message)
				self.emit('error', e)
			}
			end()
		}

		function wRes(e) {
			if (e) {
				if (!err) err = e
				writeStream = false
				write('stream error: ' + e.message)
				self.emit('error', e)
			}
			end()
		}

		function end() {
			if (!--cbCounter)
				if (cb)
					if (err) cb(err)
					else cb()
		}
	}
function write(s) {
		var err
		var args = Array.prototype.slice.call(arguments)
		var cb = typeof args[args.length - 1] === 'function' ? args.pop() : null
		var cbCounter = 1
		if (writeToStdoutEnabled) {
			cbCounter++
			process.stdout.write(s, stdWr)
		}
		if (writeStream) {
			cbCounter++
			writeStream.write(s, wRes)
		}
		end()

		function stdWr(e) {
			if (e) {
				if (!err) err = e
				writeToStdoutEnabled = false
				write('stdout error: ' + e.message)
				self.emit('error', e)
			}
			end()
		}

		function wRes(e) {
			if (e) {
				if (!err) err = e
				writeStream = false
				write('stream error: ' + e.message)
				self.emit('error', e)
			}
			end()
		}

		function end() {
			if (!--cbCounter)
				if (cb)
					if (err) cb(err)
					else cb()
		}
	}
function write ( s ) { var err var args = Array . prototype . slice . call ( arguments ) var cb = typeof args [ args . length - 1 ] === 'function' ? args . pop ( ) : null var cbCounter = 1 if ( writeToStdoutEnabled ) { cbCounter ++ process . stdout . write ( s , stdWr ) } if ( writeStream ) { cbCounter ++ writeStream . write ( s , wRes ) } end ( ) function stdWr ( e ) { if ( e ) { if ( ! err ) err = e writeToStdoutEnabled = false write ( 'stdout error: ' + e . message ) self . emit ( 'error' , e ) } end ( ) } function wRes ( e ) { if ( e ) { if ( ! err ) err = e writeStream = false write ( 'stream error: ' + e . message ) self . emit ( 'error' , e ) } end ( ) } function end ( ) { if ( ! -- cbCounter ) if ( cb ) if ( err ) cb ( err ) else cb ( ) } }
logging of utf-8 string
logging of utf - 8 string