From 8fe5814831c87616d7c3db9357a96f5cca6ef757 Mon Sep 17 00:00:00 2001
From: paweldomas <pawel.domas@jitsi.org>
Date: Wed, 5 Sep 2018 15:34:26 -0500
Subject: [PATCH] ref(JitsiMeetLogStorage): move to base/logging

---
 modules/UI/shared_video/SharedVideo.js           |  3 +--
 .../base/logging}/JitsiMeetInMemoryLogStorage.js | 13 +++++++++----
 .../base/logging}/JitsiMeetLogStorage.js         | 16 +++++++++-------
 react/features/base/logging/middleware.js        |  6 ++----
 4 files changed, 21 insertions(+), 17 deletions(-)
 rename {modules/util => react/features/base/logging}/JitsiMeetInMemoryLogStorage.js (76%)
 rename {modules/util => react/features/base/logging}/JitsiMeetLogStorage.js (85%)

diff --git a/modules/UI/shared_video/SharedVideo.js b/modules/UI/shared_video/SharedVideo.js
index 2d5d83480..73a805e08 100644
--- a/modules/UI/shared_video/SharedVideo.js
+++ b/modules/UI/shared_video/SharedVideo.js
@@ -301,8 +301,7 @@ export default class SharedVideoManager {
 
                 // FIXME The cat is out of the bag already or rather _room is
                 // not private because it is used in multiple other places
-                // already such as AbstractPageReloadOverlay and
-                // JitsiMeetLogStorage.
+                // already such as AbstractPageReloadOverlay.
                 conference: APP.conference._room,
                 id: self.url,
                 isFakeParticipant: true,
diff --git a/modules/util/JitsiMeetInMemoryLogStorage.js b/react/features/base/logging/JitsiMeetInMemoryLogStorage.js
similarity index 76%
rename from modules/util/JitsiMeetInMemoryLogStorage.js
rename to react/features/base/logging/JitsiMeetInMemoryLogStorage.js
index cf3d4648f..2e86387a1 100644
--- a/modules/util/JitsiMeetInMemoryLogStorage.js
+++ b/react/features/base/logging/JitsiMeetInMemoryLogStorage.js
@@ -1,12 +1,11 @@
 /**
  * Implements in memory logs storage, used for testing/debugging.
  *
- * FIXME: move to base/logging
  */
 export default class JitsiMeetInMemoryLogStorage {
 
     /**
-     * Creates new <tt>JitsiMeetInMemoryLogStorage</tt>
+     * Creates new <tt>JitsiMeetInMemoryLogStorage</tt>.
      */
     constructor() {
         /**
@@ -17,6 +16,8 @@ export default class JitsiMeetInMemoryLogStorage {
     }
 
     /**
+     * Checks if this storage instance is ready.
+     *
      * @returns {boolean} <tt>true</tt> when this storage is ready or
      * <tt>false</tt> otherwise.
      */
@@ -27,8 +28,10 @@ export default class JitsiMeetInMemoryLogStorage {
     /**
      * Called by the <tt>LogCollector</tt> to store a series of log lines into
      * batch.
-     * @param {string|object[]} logEntries an array containing strings
+     *
+     * @param {string|Object[]} logEntries - An array containing strings
      * representing log lines or aggregated lines objects.
+     * @returns {void}
      */
     storeLogs(logEntries) {
         for (let i = 0, len = logEntries.length; i < len; i++) {
@@ -44,7 +47,9 @@ export default class JitsiMeetInMemoryLogStorage {
     }
 
     /**
-     * @returns {array} the collected log entries.
+     * Returns the logs stored in the memory.
+     *
+     * @returns {Array<string>} The collected log entries.
      */
     getLogs() {
         return this.logs;
diff --git a/modules/util/JitsiMeetLogStorage.js b/react/features/base/logging/JitsiMeetLogStorage.js
similarity index 85%
rename from modules/util/JitsiMeetLogStorage.js
rename to react/features/base/logging/JitsiMeetLogStorage.js
index 1868ea9a3..ff952c95d 100644
--- a/modules/util/JitsiMeetLogStorage.js
+++ b/react/features/base/logging/JitsiMeetLogStorage.js
@@ -1,16 +1,16 @@
-import { getCurrentConference } from '../../react/features/base/conference';
+
+import { getCurrentConference } from '../conference';
 
 /**
- * Implements logs storage through the CallStats.
- *
- * FIXME: move to base/logging
+ * Implements log storage interface from the jitsi-meet-logger lib. Captured
+ * logs are sent to CallStats.
  */
 export default class JitsiMeetLogStorage {
 
     /**
      * Creates new <tt>JitsiMeetLogStorage</tt>.
      *
-     * @param {Function} getState - the Redux store's {@code getState} method.
+     * @param {Function} getState - The Redux store's {@code getState} method.
      */
     constructor(getState) {
         /**
@@ -33,7 +33,7 @@ export default class JitsiMeetLogStorage {
      * A conference is considered joined when the 'conference' field is defined
      * in the base/conference state.
      *
-     * @return {boolean} <tt>true</tt> when this storage is ready or
+     * @returns {boolean} <tt>true</tt> when this storage is ready or
      * <tt>false</tt> otherwise.
      */
     isReady() {
@@ -45,8 +45,10 @@ export default class JitsiMeetLogStorage {
     /**
      * Called by the <tt>LogCollector</tt> to store a series of log lines into
      * batch.
-     * @param {string|object[]}logEntries an array containing strings
+     *
+     * @param {Array<string|Object>} logEntries - An array containing strings
      * representing log lines or aggregated lines objects.
+     * @returns {void}
      */
     storeLogs(logEntries) {
         const conference = getCurrentConference(this.getState());
diff --git a/react/features/base/logging/middleware.js b/react/features/base/logging/middleware.js
index 582fe56cf..6aad5e7fb 100644
--- a/react/features/base/logging/middleware.js
+++ b/react/features/base/logging/middleware.js
@@ -10,14 +10,12 @@ import JitsiMeetJS, {
 } from '../lib-jitsi-meet';
 import { MiddlewareRegistry } from '../redux';
 
-import JitsiMeetInMemoryLogStorage
-    from '../../../../modules/util/JitsiMeetInMemoryLogStorage';
-import JitsiMeetLogStorage from '../../../../modules/util/JitsiMeetLogStorage';
-
 import { isTestModeEnabled } from '../testing';
 
 import { setLogCollector } from './actions';
 import { SET_LOGGING_CONFIG } from './actionTypes';
+import JitsiMeetLogStorage from './JitsiMeetLogStorage';
+import JitsiMeetInMemoryLogStorage from './JitsiMeetInMemoryLogStorage';
 
 declare var APP: Object;