Commit Graph

26 Commits

Author SHA1 Message Date
emizzle 46511bcfe8
Rebase updates
After the code was rebased, there were some additional changes for getting websockets logs that needed to be catered for.

When there is a call to get all logs for a process, the state entity is updated with a new array item containing all the logs (this is then reduced and selected for rendering). In the case of a websocket log that simply returns only one log item, the latest full log for the process is found in the state entities, and it’s logs are appending to with the data from the websocket.

Additionally, log limits were updated to be passed in as a parameter to the API calls from the frontend. Parameter validation (for `limit`) was also added in this commit.
2018-10-23 10:57:04 +02:00
emizzle d4d7e3b8ac
Addressed PR comments
*Console.js*
- Moved `DEFAULT_PROCESS` const to outside of the `Console` class (but inside the module).
- Removed `(` and `)` from `.filter` in `getProcessLogs()`.
- Updated comments

*logger.js*
- Moved `dateFormat` and `logRegex` to constants outside of `Logger` class
- Moved the `parseLogFile` method inside of the `Logger` class (ES6 style)
- Added a log limit to the `parseLogFile` method
- Added the log path to the constants file and used inside of `Logger`

*cmd_controller.js*
- Defaulted `this.context` to `[constants.context.any]` in the constructor.
- Changed `’embark’` to split modules`coreProcess` and `loggerApi`.

*engine.js*
- Changed `’embark’` to split modules`coreProcess` and `loggerApi`.
2018-10-23 10:57:04 +02:00
emizzle 0760965bda
Overwrite log file so .embark doesn’t bloat
The embark log file is being overwritten each time embark is run. There is a separate log file for each context, so that running, for example, `embark run` then `embark console` doesn’t get the `run` log overwritten with the `console` log.
2018-10-23 10:54:35 +02:00
emizzle 7de72cb474
Addressed PR feedback
- Created an “embark” module so that an “embark” process could be registered in the correct way. This service is only used on `embark run` (can be extended to other commands if needed).

- extracted “embark” to a const `DEFAULT_PROCESS` param in the `Console` component.

- extracted commands result rendering to it’s own function to keep the `renderTabs` function from getting cluttered

- Added sorting of logs by timestamp

- Added milliseconds to the log file data (which helps in sorting log messages).
2018-10-23 10:53:25 +02:00
emizzle 42cc9b559f
Fills embark logs tabs with existing embark logs
A logfile is now generated by default, in the format `.embark/embark-log__YYYY-MM-DD_HH-mm-ss.log`.

When the home tab is loaded, the process logs are fetched for all the processes. The list of processes returned now includes `embark`, and when `/embark-api/process-logs/embark` is fetched, the logFile is parsed and an array of log messages are returned.
2018-10-23 10:52:26 +02:00
Jonathan Rainville 459d0cc2d6
small conflicts 2018-10-23 10:23:43 +02:00
Anthony Laibe 57874bac71
Use path embark-api 2018-10-23 10:22:37 +02:00
Iuri Matias 6c88ebd874
move logger api call into logger 2018-10-23 10:21:36 +02:00
Iuri Matias 5de1c6e539
trigger log events for all log levels 2018-10-23 10:20:08 +02:00
Jonathan Rainville 7a70f5df26
use constants instead of magic numbers 2018-10-22 19:54:47 +02:00
Iuri Matias 2baa6ed792 make linter happy 2018-08-21 15:30:11 -04:00
Iuri Matias 1efdc00471 fix console log for undefined params 2018-08-21 15:30:11 -04:00
Jonathan Rainville 8ecd382a1f enable logger to log multiple arguments 2018-08-21 15:03:34 -04:00
emizzle 96495b99c3 Support setting log level as an argument
* Add loglevel and logfile switch to `embark build`
* Support existing `loglevel` and `logfile` switch for `embark run/upload`
* make casing consistent for `loglevel` and `logfile`
* remove passing engine to `build()` and instead pass needed objects in options.
* prevent duplicate plugin initiation (above point)
* allow `Events` object to be passed to `Engine` constructor and `init()`
* prevent echo of upload commands to allow interception and control via logging
2018-04-19 14:25:43 +10:00
Iuri Matias 3a89b3f951 intercept dir and pass it to the logger 2018-04-09 15:24:01 -04:00
Iuri Matias 9582efbe65 fix logger call 2018-03-15 17:18:20 -04:00
Iuri Matias c1d258b819 add events to logger 2018-03-15 16:44:05 -04:00
Iuri Matias 83227beaa1 add option to specify a logfile to output the logs 2018-03-10 13:45:56 -05:00
Iuri Matias 445133cfdf move setStatus from logger to event bus 2018-02-27 15:49:21 -05:00
Iuri Matias 66e9d6afa3 move contractsState from logger to event bus 2018-02-27 15:40:05 -05:00
Iuri Matias e2cbc2a488 fix linting issues 2017-12-05 18:14:46 -05:00
roo2 5232f0e74d fix crash in logger if message is null or undefined 2017-04-09 14:55:24 +10:00
Todd Baur 67f325f5a0 migrate all the code to ES6 2017-03-30 20:12:39 +09:00
Todd Baur 5bf1475ea4 swap more var -> let 2017-03-30 02:50:05 +09:00
Iuri Matias 173c571147 remove old services monitor; add new services monitor to engine; move previous checks to their modules inits 2017-03-10 22:00:30 -05:00
Iuri Matias 1868788342 reorgnize code structure 2017-02-19 12:51:32 -05:00