@ps-aux/nodebup 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -115,7 +115,7 @@ let PgBackupController = (_dec = (0, _inversify.injectable)(), _dec2 = Reflect.m
115
115
  this.zip.unzipDir(zipFile, dir);
116
116
  this.fs.rmFile(zipFile);
117
117
  const outFile = this.fs.listFiles(dir)[0];
118
- this.log.debug('Will run psql import from %s', outFile); // Don't forget that this itself might be run in docker
118
+ this.log.debug('Will run psql import from %s', outFile.str()); // Don't forget that this itself might be run in docker
119
119
  // therefore volume mounts are not usable (will apply to the location at host)
120
120
 
121
121
  this.sh.exec(`docker run --network host -i ` + `postgres:${version} ` + `psql ${pgUrl} -v ON_ERROR_STOP=0 < ${outFile.str()}`);
@@ -3,13 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TaskConfig_ = exports.StorageConfig_ = exports.Log_ = exports.Inputs_ = exports.AppConfig_ = void 0;
7
- const Log_ = Symbol.for('Log');
8
- exports.Log_ = Log_;
9
- const TaskConfig_ = Symbol.for('config.Tasks');
10
- exports.TaskConfig_ = TaskConfig_;
11
- const StorageConfig_ = Symbol.for('config.Storage');
12
- exports.StorageConfig_ = StorageConfig_;
6
+ exports.Inputs_ = exports.AppConfig_ = void 0;
13
7
  const AppConfig_ = Symbol.for('config.app');
14
8
  exports.AppConfig_ = AppConfig_;
15
9
  const Inputs_ = Symbol.for('cmd.input');
package/lib/fs/Fs.test.js CHANGED
@@ -7,12 +7,9 @@ var _Path = require("./path/Path");
7
7
  it.skip('withTmpDir', async () => {
8
8
  const fs = new _Fs.Fs(_Path.AbsPath.from(__dirname));
9
9
  await fs.inTmpDir('foo', async () => {
10
- console.log('before');
11
10
  const wait = new Promise((res, rej) => {
12
11
  setTimeout(res, 1000);
13
12
  });
14
13
  await wait;
15
- console.log('after');
16
14
  });
17
- console.log('done');
18
15
  });
@@ -13,15 +13,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
13
  const level = process.env.NODEBUP_LOG_LEVEL || 'trace';
14
14
  const root = (0, _pino.default)({
15
15
  name: 'root',
16
- transport: {
17
- target: 'pino-pretty'
18
- },
16
+ prettyPrint: true,
17
+ // - This will lead to problems with logging to stdout
18
+ // 1. No logging in Jest
19
+ // 2. Not logging when run as CLI app
20
+ // transport: { target: 'pino-pretty' },
19
21
  level
20
22
  });
21
23
 
22
24
  const makeLog = name => {
23
25
  return root.child({
24
- name
26
+ name,
27
+ level
25
28
  });
26
29
  }; // TODO make type narrower
27
30
 
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ var _logging = require("./logging");
4
+
5
+ it('test', () => {
6
+ class A {}
7
+
8
+ const log = (0, _logging.classObjLog)(new A());
9
+ log.info('test');
10
+ });
@@ -31,7 +31,7 @@ class ResticClient {
31
31
  _defineProperty(this, "log", (0, _logging.classObjLog)(this));
32
32
 
33
33
  _defineProperty(this, "prepareRepo", () => {
34
- this.log.info(`Preparing a restic repo at '${this.url}`);
34
+ this.log.info('Preparing a restic repo at %s', this.url);
35
35
  this.shell.exec(`restic init`, {
36
36
  env: this.env()
37
37
  });
@@ -44,7 +44,7 @@ class ResticClient {
44
44
  });
45
45
 
46
46
  _defineProperty(this, "backup", (cwd, from, tags = []) => {
47
- this.log.debug(`Running backup for repo=${this.url}`);
47
+ this.log.debug('Running backup for repo=%s', this.url);
48
48
  let cmd = `restic backup ${from.str()}`;
49
49
  tags.forEach(t => {
50
50
  cmd += ` --tag=${t}`;
@@ -56,14 +56,14 @@ class ResticClient {
56
56
  });
57
57
 
58
58
  _defineProperty(this, "restore", (to, snapshotId = 'latest') => {
59
- this.log.debug('Running restore for repo=', this.url);
59
+ this.log.debug('Running restore for repo=%s', this.url);
60
60
  this.shell.exec(`restic restore ${snapshotId} --target ${to.str()}`, {
61
61
  env: this.env()
62
62
  });
63
63
  });
64
64
 
65
65
  _defineProperty(this, "forget", () => {
66
- this.log.debug(`Pruning repo=${this.url}`);
66
+ this.log.debug('Pruning repo=%s', this.url);
67
67
  const cfg = {
68
68
  hourly: 6,
69
69
  daily: 7,
@@ -77,7 +77,7 @@ class ResticClient {
77
77
  });
78
78
 
79
79
  _defineProperty(this, "snapshots", () => {
80
- this.log.debug(`Listing snapshots of repo=${this.url}`);
80
+ this.log.debug('Listing snapshots of repo=%', this.url);
81
81
  const out = this.shell.execAndReturnString(`restic snapshots --json`, {
82
82
  env: this.env()
83
83
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ps-aux/nodebup",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "",
5
5
  "module": "lib/index.js",
6
6
  "main": "lib/index.js",
package/lib/types.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });