Skip to content

Commit

Permalink
Rename setting jsonHighlightColors into highlightStyles to make it mo…
Browse files Browse the repository at this point in the history
…re generic (is used for utils.inspect)
  • Loading branch information
terehov committed May 24, 2020
1 parent 1ae3bb1 commit d496eb3
Show file tree
Hide file tree
Showing 20 changed files with 171 additions and 151 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,21 @@ _There is no `console.fatal`._

This setting allows you to overwrite the default log level colors of `tslog`.

##### `jsonHighlightColors`
##### `utilInspectStyles`
This setting allows you to overwrite the default colors of `tslog` used for the native Node.js `utils.inspect` interpolation.
More Details: <a href="https://nodejs.org/api/util.html#util_customizing_util_inspect_colors" target="_blank">Customizing util.inspect colors</a>

_Default colors set by `tslog` are:_
```js
{
name: "greenBright",
string: "redBright",
number: "blueBright",
null: "red",
undefined: "red"
}
```

This setting allows you to overwrite the default colors of _JSON_ interpolation.

##### `stdOut` and `stdErr`

Expand Down
6 changes: 3 additions & 3 deletions docs/api_extractor/tslog.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export interface ISettings extends ISettingsParam {
// (undocumented)
exposeStack: boolean;
// (undocumented)
instanceName?: string;
highlightStyles: IUtilsInspectStyles;
// (undocumented)
jsonHighlightColors: IUtilsInspectStyles;
instanceName?: string;
// (undocumented)
logAsJson: boolean;
// (undocumented)
Expand All @@ -98,8 +98,8 @@ export interface ISettingsParam {
exposeErrorCodeFrame?: boolean;
exposeErrorCodeFrameLinesBeforeAndAfter?: number;
exposeStack?: boolean;
highlightStyles?: IUtilsInspectStyles;
instanceName?: string;
jsonHighlightColors?: IUtilsInspectStyles;
logAsJson?: boolean;
logLevelsColors?: TLogLevelColor;
minLevel?: TLogLevelName;
Expand Down
2 changes: 1 addition & 1 deletion docs/tsdoc/assets/js/search.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions docs/tsdoc/classes/logger.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h3>constructor</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/index.ts#L65">index.ts:65</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/index.ts#L64">index.ts:64</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -150,7 +150,7 @@ <h3><span class="tsd-flag ts-flagReadonly">Readonly</span> settings</h3>
<div class="tsd-signature tsd-kind-icon">settings<span class="tsd-signature-symbol">:</span> <a href="../interfaces/isettings.html" class="tsd-signature-type">ISettings</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/index.ts#L65">index.ts:65</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/index.ts#L64">index.ts:64</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -172,7 +172,7 @@ <h3>attach<wbr>Transport</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/index.ts#L130">index.ts:130</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/index.ts#L129">index.ts:129</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -209,7 +209,7 @@ <h3>debug</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/index.ts#L160">index.ts:160</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/index.ts#L159">index.ts:159</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -240,7 +240,7 @@ <h3>error</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/index.ts#L184">index.ts:184</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/index.ts#L183">index.ts:183</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -271,7 +271,7 @@ <h3>fatal</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/index.ts#L192">index.ts:192</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/index.ts#L191">index.ts:191</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -302,7 +302,7 @@ <h3>info</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/index.ts#L168">index.ts:168</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/index.ts#L167">index.ts:167</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -333,7 +333,7 @@ <h3>silly</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/index.ts#L144">index.ts:144</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/index.ts#L143">index.ts:143</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -364,7 +364,7 @@ <h3>trace</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/index.ts#L152">index.ts:152</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/index.ts#L151">index.ts:151</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -395,7 +395,7 @@ <h3>warn</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/index.ts#L176">index.ts:176</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/index.ts#L175">index.ts:175</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
10 changes: 5 additions & 5 deletions docs/tsdoc/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h3>TLog<wbr>Level<wbr>Color</h3>
<div class="tsd-signature tsd-kind-icon">TLog<wbr>Level<wbr>Color<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{}</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L33">interfaces.ts:33</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L33">interfaces.ts:33</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -126,7 +126,7 @@ <h3>TLog<wbr>Level<wbr>Id</h3>
<div class="tsd-signature tsd-kind-icon">TLog<wbr>Level<wbr>Id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">keyof </span><a href="interfaces/iloglevel.html" class="tsd-signature-type">ILogLevel</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L21">interfaces.ts:21</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L21">interfaces.ts:21</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -141,7 +141,7 @@ <h3>TLog<wbr>Level<wbr>Name</h3>
<div class="tsd-signature tsd-kind-icon">TLog<wbr>Level<wbr>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ILogLevel</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">TLogLevelId</span><span class="tsd-signature-symbol">]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L27">interfaces.ts:27</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L27">interfaces.ts:27</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -156,7 +156,7 @@ <h3>TTransport<wbr>Logger</h3>
<div class="tsd-signature tsd-kind-icon">TTransport<wbr>Logger&lt;T&gt;<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{}</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L189">interfaces.ts:189</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L189">interfaces.ts:189</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -182,7 +182,7 @@ <h3>TUtils<wbr>Inspect<wbr>Colors</h3>
<div class="tsd-signature tsd-kind-icon">TUtils<wbr>Inspect<wbr>Colors<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"reset"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bold"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"dim"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"italic"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"underline"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"blink"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"inverse"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"hidden"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"strikethrough"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"doubleunderline"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"black"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"red"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"green"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"yellow"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"blue"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"magenta"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"cyan"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"white"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgBlack"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgRed"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgGreen"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgYellow"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgBlue"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgMagenta"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgCyan"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgWhite"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"framed"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"overlined"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"gray"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"redBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"greenBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"yellowBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"blueBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"magentaBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"cyanBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"whiteBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgGray"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgRedBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgGreenBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgYellowBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgBlueBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgMagentaBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgCyanBright"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"bgWhiteBright"</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L202">interfaces.ts:202</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L202">interfaces.ts:202</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
15 changes: 12 additions & 3 deletions docs/tsdoc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,19 @@ <h5><code>overwriteConsole</code></h5>
<h5><code>logLevelsColors</code></h5>
</a>
<p>This setting allows you to overwrite the default log level colors of <code>tslog</code>.</p>
<a href="#jsonhighlightcolors" id="jsonhighlightcolors" style="color: inherit; text-decoration: none;">
<h5><code>jsonHighlightColors</code></h5>
<a href="#utilinspectstyles" id="utilinspectstyles" style="color: inherit; text-decoration: none;">
<h5><code>utilInspectStyles</code></h5>
</a>
<p>This setting allows you to overwrite the default colors of <em>JSON</em> interpolation.</p>
<p>This setting allows you to overwrite the default colors of <code>tslog</code> used for the native Node.js <code>utils.inspect</code> interpolation.
More Details: <a href="https://nodejs.org/api/util.html#util_customizing_util_inspect_colors" target="_blank">Customizing util.inspect colors</a></p>
<p><em>Default colors set by <code>tslog</code> are:</em></p>
<pre><code class="language-js">{
<span class="hljs-attr">name</span>: <span class="hljs-string">"greenBright"</span>,
<span class="hljs-attr">string</span>: <span class="hljs-string">"redBright"</span>,
<span class="hljs-attr">number</span>: <span class="hljs-string">"blueBright"</span>,
<span class="hljs-attr">null</span>: <span class="hljs-string">"red"</span>,
<span class="hljs-attr">undefined</span>: <span class="hljs-string">"red"</span>
}</code></pre>
<a href="#stdout-and-stderr" id="stdout-and-stderr" style="color: inherit; text-decoration: none;">
<h5><code>stdOut</code> and <code>stdErr</code></h5>
</a>
Expand Down
12 changes: 6 additions & 6 deletions docs/tsdoc/interfaces/icodeframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h3>column<wbr>Number</h3>
<div class="tsd-signature tsd-kind-icon">column<wbr>Number<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L283">interfaces.ts:283</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L283">interfaces.ts:283</a></li>
</ul>
</aside>
</section>
Expand All @@ -113,7 +113,7 @@ <h3>first<wbr>Line<wbr>Number</h3>
<div class="tsd-signature tsd-kind-icon">first<wbr>Line<wbr>Number<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L281">interfaces.ts:281</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L281">interfaces.ts:281</a></li>
</ul>
</aside>
</section>
Expand All @@ -123,7 +123,7 @@ <h3>line<wbr>Number</h3>
<div class="tsd-signature tsd-kind-icon">line<wbr>Number<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L282">interfaces.ts:282</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L282">interfaces.ts:282</a></li>
</ul>
</aside>
</section>
Expand All @@ -133,7 +133,7 @@ <h3>lines<wbr>After</h3>
<div class="tsd-signature tsd-kind-icon">lines<wbr>After<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L286">interfaces.ts:286</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L286">interfaces.ts:286</a></li>
</ul>
</aside>
</section>
Expand All @@ -143,7 +143,7 @@ <h3>lines<wbr>Before</h3>
<div class="tsd-signature tsd-kind-icon">lines<wbr>Before<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L284">interfaces.ts:284</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L284">interfaces.ts:284</a></li>
</ul>
</aside>
</section>
Expand All @@ -153,7 +153,7 @@ <h3>relevant<wbr>Line</h3>
<div class="tsd-signature tsd-kind-icon">relevant<wbr>Line<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/43a96f4/src/interfaces.ts#L285">interfaces.ts:285</a></li>
<li>Defined in <a href="https://github.com/fullstack-build/tslog/blob/1ae3bb1/src/interfaces.ts#L285">interfaces.ts:285</a></li>
</ul>
</aside>
</section>
Expand Down
Loading

0 comments on commit d496eb3

Please sign in to comment.