Page MenuHomeDevCentral

Initial revision
ClosedPublic

Authored by dereckson on Oct 16 2017, 00:03.
Tags
None
Referenced Files
F3805218: D1060.id.diff
Sat, Nov 30, 01:26
F3805145: D1060.diff
Sat, Nov 30, 01:05
Unknown Object (File)
Tue, Nov 26, 22:38
Unknown Object (File)
Tue, Nov 19, 13:43
Unknown Object (File)
Tue, Nov 19, 05:43
Unknown Object (File)
Mon, Nov 18, 04:46
Unknown Object (File)
Mon, Nov 18, 03:35
Unknown Object (File)
Tue, Nov 12, 23:25
Subscribers
None

Details

Summary

This service adds a log entry to a log JSON document. That will allow to serve
an up-to-date all.json file pending a more robust microservice (see rSERVERSLOG).

Test Plan

Unit tests provided for the Log class.

Furthermore, a test client in TCL has been prepared to test also the adder code.

Diff Detail

Repository
rAPISRVLOGS Servers log :: Add new entries API
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson added inline comments.
composer.json
15

psr7 AND log aren't used

src/LogEntry.php
39

\n

Move JSON Mapper to LogEntry

dereckson marked an inline comment as done.

Fix whiteline before class end, prune non used Composer packages

Client code used to test this code

  1. Prepare a dict with required information, e.g. [list date 1974 emitter Tests source LogTest.php component Acme entry "Something happens."]
  2. Use dict2json (provided below) to convert it into a JSON payload
  3. Use rest or http package to post to the API entry point
proc dict2json {dictToEncode} {
    ::json::write object {*}[dict map {k v} $dictToEncode {
        set v [::json::write string $v]
    }]
}

Add the TCL test client documented in comment.

This revision is now accepted and ready to land.Feb 15 2018, 12:36
This revision was automatically updated to reflect the committed changes.