Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.

Commit e46c720

Browse files
authored
Modularization: Switch to 'oni-core-logging' (#2283)
* Start migrating from Log.ts -> oni-core-logging * Refactor remaining references * Fix lint issues
1 parent e1dd0cd commit e46c720

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+97
-153
lines changed

browser/src/App.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as path from "path"
1111

1212
import { IDisposable } from "oni-types"
1313

14-
import * as Log from "./Log"
14+
import * as Log from "oni-core-logging"
1515
import * as Performance from "./Performance"
1616
import * as Utility from "./Utility"
1717

browser/src/Editor/BufferManager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { Store } from "redux"
1818
import * as detectIndent from "detect-indent"
1919

2020
import * as Oni from "oni-api"
21+
import * as Log from "oni-core-logging"
2122

2223
import {
2324
BufferEventContext,
@@ -38,7 +39,6 @@ import * as Actions from "./NeovimEditor/NeovimEditorActions"
3839
import * as State from "./NeovimEditor/NeovimEditorStore"
3940

4041
import * as Constants from "./../Constants"
41-
import * as Log from "./../Log"
4242
import { TokenColor } from "./../Services/TokenColors"
4343

4444
import { IBufferLayer } from "./NeovimEditor/BufferLayerManager"

browser/src/Editor/NeovimEditor/NeovimEditor.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ import { bindActionCreators, Store } from "redux"
2020
import { clipboard, ipcRenderer } from "electron"
2121

2222
import * as Oni from "oni-api"
23+
import * as Log from "oni-core-logging"
2324
import { Event, IEvent } from "oni-types"
2425

25-
import * as Log from "./../../Log"
26-
2726
import { addDefaultUnitIfNeeded } from "./../../Font"
2827
import {
2928
BufferEventContext,

browser/src/Editor/NeovimEditor/Rename.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import * as React from "react"
66

77
import * as Oni from "oni-api"
8+
import * as Log from "oni-core-logging"
89

9-
import * as Log from "./../../Log"
1010
import * as Helpers from "./../../Plugins/Api/LanguageClient/LanguageClientHelpers"
1111

1212
import { LanguageManager } from "./../../Services/Language"

browser/src/Editor/NeovimEditor/markdown.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { unescape } from "lodash"
22
import * as marked from "marked"
33

4-
import * as Log from "./../../Log"
4+
import * as Log from "oni-core-logging"
55
import { IGrammarPerLine, IGrammarToken } from "./../../Services/SyntaxHighlighting/TokenGenerator"
66

77
import * as DOMPurify from "dompurify"

browser/src/Editor/OniEditor/OniEditor.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import * as React from "react"
1212
import * as types from "vscode-languageserver-types"
1313

1414
import * as Oni from "oni-api"
15+
import * as Log from "oni-core-logging"
1516
import { IEvent } from "oni-types"
1617

1718
// import { remote } from "electron"
1819

1920
import * as App from "./../../App"
20-
import * as Log from "./../../Log"
2121
import * as Utility from "./../../Utility"
2222

2323
import { PluginManager } from "./../../Plugins/PluginManager"

browser/src/Input/Keyboard/KeyboardLayout.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import * as Log from "oni-core-logging"
12
import { Event, IEvent } from "oni-types"
23

3-
import * as Log from "./../../Log"
44
import * as Platform from "./../../Platform"
55

66
export interface IKeyMap {

browser/src/Input/Keyboard/KeyboardResolver.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
*
44
* Manages set of resolvers, and adding/removing resolvers.
55
*/
6+
import * as Log from "oni-core-logging"
67
import { IDisposable } from "oni-types"
78

8-
import * as Log from "./../../Log"
9-
109
import { KeyResolver } from "./Resolvers"
1110

1211
export class KeyboardResolver {

browser/src/Log.ts

-61
This file was deleted.

browser/src/PeriodicJobs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import * as Log from "oni-core-logging"
12
import * as Constants from "./Constants"
2-
import * as Log from "./Log"
33

44
// IPeriodicJob implements the interface for a long-running job
55
// that would be expensive to run synchronously, so it is

browser/src/PersistentStore.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { remote } from "electron"
88

9-
import * as Log from "./Log"
9+
import * as Log from "oni-core-logging"
1010

1111
// We need to use the 'main process' version of electron-settings.
1212
// See: https://github.com/nathanbuchar/electron-settings/wiki/FAQs

browser/src/Plugins/Api/LanguageClient/LanguageClientLogger.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Helper utility for handling logging from language service clients
55
*/
66

7-
import * as Log from "./../../../Log"
7+
import * as Log from "oni-core-logging"
88

99
export class LanguageClientLogger {
1010
public error(message: string): void {

browser/src/Plugins/Api/Oni.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import * as ChildProcess from "child_process"
99

1010
import * as OniApi from "oni-api"
11+
import * as Log from "oni-core-logging"
1112

1213
import Process from "./Process"
1314
import { Services } from "./Services"
@@ -38,8 +39,6 @@ import { getInstance as getTokenColorsInstance } from "./../../Services/TokenCol
3839
import { windowManager } from "./../../Services/WindowManager"
3940
import { getInstance as getWorkspaceInstance } from "./../../Services/Workspace"
4041

41-
import * as Log from "./../../Log"
42-
4342
import * as throttle from "lodash/throttle"
4443

4544
const react = require("react") // tslint:disable-line no-var-requires

browser/src/Plugins/Api/Process.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import * as ChildProcess from "child_process"
22

33
import * as Oni from "oni-api"
4-
import * as Log from "./../../Log"
4+
import * as Log from "oni-core-logging"
5+
56
import * as Platform from "./../../Platform"
67
import { configuration } from "./../../Services/Configuration"
78

browser/src/Plugins/PackageMetadataParser.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import * as fs from "fs"
88
import * as path from "path"
99

10-
import * as Capabilities from "./Api/Capabilities"
10+
import * as Log from "oni-core-logging"
1111

12-
import * as Log from "./../Log"
12+
import * as Capabilities from "./Api/Capabilities"
1313

1414
const remapToAbsolutePaths = (
1515
packageRoot: string,

browser/src/Plugins/Plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as fs from "fs"
22
import * as path from "path"
33

4-
import * as Log from "./../Log"
4+
import * as Log from "oni-core-logging"
55

66
import * as Capabilities from "./Api/Capabilities"
77
import { Oni } from "./Api/Oni"

browser/src/Plugins/PluginConfigurationSynchronizer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Responsible for synchronizing user's `plugin` configuration settings.
55
*/
66

7-
import * as Log from "./../Log"
7+
import * as Log from "oni-core-logging"
88

99
import { Configuration } from "./../Services/Configuration"
1010
import { PluginManager } from "./PluginManager"

browser/src/Plugins/PluginInstaller.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import * as path from "path"
88

9+
import * as Log from "oni-core-logging"
910
import { Event, IEvent } from "oni-types"
1011

1112
// import * as Oni from "oni-api"
@@ -20,8 +21,6 @@ import { IFileSystem, OniFileSystem } from "./../Services/Explorer/ExplorerFileS
2021

2122
import Process from "./Api/Process"
2223

23-
import * as Log from "./../Log"
24-
2524
/**
2625
* Plugin identifier:
2726
* - For _git_, this should be of the form `welle/targets.vim`

browser/src/Redux/LoggingMiddleware.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { Store } from "redux"
88

9-
import * as Log from "./../Log"
9+
import * as Log from "oni-core-logging"
1010

1111
export const createLoggingMiddleware = (storeName: string) => (store: Store<any>) => (
1212
next: any,

browser/src/Services/AutoClosingPairs.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import * as Oni from "oni-api"
8+
import * as Log from "oni-core-logging"
89

910
import { IBuffer } from "./../Editor/BufferManager"
1011
import { Configuration } from "./Configuration"
@@ -14,8 +15,6 @@ import { LanguageManager } from "./Language"
1415

1516
import { NeovimInstance } from "./../neovim"
1617

17-
import * as Log from "./../Log"
18-
1918
export interface IAutoClosingPair {
2019
open: string
2120
close: string

browser/src/Services/Automation.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { remote } from "electron"
88

99
import * as OniApi from "oni-api"
10+
import * as Log from "oni-core-logging"
1011

1112
import * as App from "./../App"
1213
import * as Utility from "./../Utility"
@@ -15,8 +16,6 @@ import { getUserConfigFilePath } from "./Configuration"
1516
import { editorManager } from "./EditorManager"
1617
import { inputManager } from "./InputManager"
1718

18-
import * as Log from "./../Log"
19-
2019
import { IKey, parseKeysFromVimString } from "./../Input/KeyParser"
2120

2221
export interface ITestResult {

browser/src/Services/CommandManager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import * as values from "lodash/values"
88

99
import * as Oni from "oni-api"
10+
import * as Log from "oni-core-logging"
1011

11-
import * as Log from "./../Log"
1212
import { INeovimInstance } from "./../neovim"
1313
import { ITask, ITaskProvider } from "./Tasks"
1414

browser/src/Services/Completion/CompletionsRequestor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import * as types from "vscode-languageserver-types"
88

9-
import * as Log from "./../../Log"
9+
import * as Log from "oni-core-logging"
1010
import * as Helpers from "./../../Plugins/Api/LanguageClient/LanguageClientHelpers"
1111

1212
import { LanguageManager } from "./../Language"

browser/src/Services/Configuration/Configuration.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
import { merge } from "lodash"
66
import * as Oni from "oni-api"
7+
import * as Log from "oni-core-logging"
78
import { Event, IDisposable, IEvent } from "oni-types"
89
import { applyDefaultKeyBindings } from "./../../Input/KeyBindings"
9-
import * as Log from "./../../Log"
1010
import * as Performance from "./../../Performance"
1111
import { diff } from "./../../Utility"
1212

browser/src/Services/Configuration/ConfigurationEditor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as path from "path"
99

1010
import * as mkdirp from "mkdirp"
1111

12-
import * as Log from "./../../Log"
12+
import * as Log from "oni-core-logging"
1313

1414
import { EditorManager } from "./../EditorManager"
1515

browser/src/Services/Configuration/DeprecatedConfigurationValues.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* deprecation policy in place - like we'll support deprecated configurations for x releases.
77
*/
88

9-
import * as Log from "./../../Log"
9+
import * as Log from "oni-core-logging"
1010

1111
export interface IDeprecatedConfigurationInfo {
1212
replacementConfigurationName: string

browser/src/Services/Configuration/FileConfigurationProvider.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ import "rxjs/add/operator/debounceTime"
1313
import { Subject } from "rxjs/Subject"
1414

1515
import * as Oni from "oni-api"
16+
import * as Log from "oni-core-logging"
1617
import { Event, IEvent } from "oni-types"
1718

18-
import * as Log from "./../../Log"
19-
2019
import { IConfigurationProvider } from "./Configuration"
2120
import { IConfigurationValues } from "./IConfigurationValues"
2221

browser/src/Services/Configuration/UserConfiguration.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import * as path from "path"
88

9-
import * as Platform from "./../../Platform"
9+
import * as Log from "oni-core-logging"
1010

11-
import * as Log from "./../../Log"
11+
import * as Platform from "./../../Platform"
1212

1313
export const getUserConfigFilePath = (): string => {
1414
const configFileFromEnv = process.env["ONI_CONFIG_FILE"] as string // tslint:disable-line

browser/src/Services/Explorer/ExplorerStore.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import { forkJoin } from "rxjs/observable/forkJoin"
1616
import { fromPromise } from "rxjs/observable/fromPromise"
1717
import { timer } from "rxjs/observable/timer"
1818

19-
import * as Log from "./../../Log"
19+
import * as Log from "oni-core-logging"
20+
2021
import { createStore as createReduxStore } from "./../../Redux"
2122
import { configuration } from "./../Configuration"
2223
import { EmptyNode, ExplorerNode } from "./ExplorerSelectors"
@@ -801,7 +802,9 @@ const persistOrDeleteNode = async (
801802

802803
export const undoEpic: ExplorerEpic = (action$, store, { fileSystem }) =>
803804
action$.ofType("UNDO").mergeMap(action => {
804-
const { register: { undo } } = store.getState()
805+
const {
806+
register: { undo },
807+
} = store.getState()
805808
const lastAction = last(undo)
806809

807810
switch (lastAction.type) {
@@ -919,7 +922,11 @@ const expandDirectoryEpic: ExplorerEpic = (action$, store, { fileSystem }) =>
919922

920923
export const createNodeEpic: ExplorerEpic = (action$, store, { fileSystem }) =>
921924
action$.ofType("CREATE_NODE_COMMIT").mergeMap(({ name }: ICreateNodeCommitAction) => {
922-
const { register: { create: { nodeType } } } = store.getState()
925+
const {
926+
register: {
927+
create: { nodeType },
928+
},
929+
} = store.getState()
923930
const shouldExpand = Actions.expandDirectory(path.dirname(name))
924931
const createFileOrFolder =
925932
nodeType === "file" ? fileSystem.writeFile(name) : fileSystem.mkdir(name)

0 commit comments

Comments
 (0)