1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Made fs functions work again in cli

This commit is contained in:
Laurent Cozic
2017-07-05 22:52:31 +01:00
parent 8adb5a71c5
commit a81fe24368
5 changed files with 48 additions and 5 deletions

View File

@ -1,6 +1,6 @@
import moment from 'moment';
// import fs from 'fs-extra';
import { _ } from 'lib/locale.js';
import FsDriverDummy from 'lib/fs-driver-dummy.js';
class Logger {
@ -10,6 +10,11 @@ class Logger {
this.fileAppendQueue_ = []
}
static fsDriver() {
if (!Logger.fsDriver_) Logger.fsDriver_ = new FsDriverDummy();
return Logger.fsDriver_;
}
setLevel(level) {
this.level_ = level;
}
@ -67,8 +72,7 @@ class Logger {
serializedObject = object;
}
// RNFIX: Temporary disabled for React Native
// fs.appendFileSync(t.path, line + serializedObject + "\n");
Logger.fsDriver().appendFileSync(t.path, line + serializedObject + "\n");
// this.fileAppendQueue_.push({
// path: t.path,