Skip to content

Commit

Permalink
fix(logging): Added mkdir option to create logging directory
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Dec 23, 2023
1 parent fde4545 commit df62ea7
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 77 deletions.
16 changes: 4 additions & 12 deletions docs/api-reports/packages/date-time/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ export { deserializeStormTime as deserializeStormTime_alias_1 };
// @public
const formatDate: (
dateTime?: StormDateTime,
options?: Partial<
Temporal.ToStringPrecisionOptions & Temporal.ShowCalendarOption
>
options?: Partial<Temporal.ZonedDateTimeToStringOptions>
) => string;
export { formatDate };
export { formatDate as formatDate_alias_1 };
Expand All @@ -89,9 +87,7 @@ export { formatDate as formatDate_alias_2 };
// @public
const formatDateTime: (
dateTime?: StormDateTime,
options?: Partial<
Temporal.ToStringPrecisionOptions & Temporal.ShowCalendarOption
>
options?: Partial<Temporal.ZonedDateTimeToStringOptions>
) => string;
export { formatDateTime };
export { formatDateTime as formatDateTime_alias_1 };
Expand All @@ -100,9 +96,7 @@ export { formatDateTime as formatDateTime_alias_2 };
// @public
const formatDateTimeISO: (
dateTime?: StormDateTime | null,
options?: Partial<
Temporal.ToStringPrecisionOptions & Temporal.ShowCalendarOption
>
options?: Partial<Temporal.ZonedDateTimeToStringOptions>
) => string;
export { formatDateTimeISO };
export { formatDateTimeISO as formatDateTimeISO_alias_1 };
Expand Down Expand Up @@ -137,9 +131,7 @@ export { FormatSinceOptions as FormatSinceOptions_alias_2 };
// @public
const formatTime: (
dateTime?: StormDateTime,
options?: Partial<
Temporal.ToStringPrecisionOptions & Temporal.ShowCalendarOption
>
options?: Partial<Temporal.ZonedDateTimeToStringOptions>
) => string;
export { formatTime };
export { formatTime as formatTime_alias_1 };
Expand Down
60 changes: 12 additions & 48 deletions docs/api-reports/packages/date-time/documents-model.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -730,17 +730,8 @@
},
{
"kind": "Reference",
"text": "Temporal.ToStringPrecisionOptions",
"canonicalReference": "!Temporal.ToStringPrecisionOptions:type"
},
{
"kind": "Content",
"text": " & "
},
{
"kind": "Reference",
"text": "Temporal.ShowCalendarOption",
"canonicalReference": "!Temporal.ShowCalendarOption:type"
"text": "Temporal.ZonedDateTimeToStringOptions",
"canonicalReference": "!Temporal.ZonedDateTimeToStringOptions:type"
},
{
"kind": "Content",
Expand All @@ -753,7 +744,7 @@
"name": "formatDate",
"variableTypeTokenRange": {
"startIndex": 1,
"endIndex": 10
"endIndex": 8
}
},
{
Expand Down Expand Up @@ -789,17 +780,8 @@
},
{
"kind": "Reference",
"text": "Temporal.ToStringPrecisionOptions",
"canonicalReference": "!Temporal.ToStringPrecisionOptions:type"
},
{
"kind": "Content",
"text": " & "
},
{
"kind": "Reference",
"text": "Temporal.ShowCalendarOption",
"canonicalReference": "!Temporal.ShowCalendarOption:type"
"text": "Temporal.ZonedDateTimeToStringOptions",
"canonicalReference": "!Temporal.ZonedDateTimeToStringOptions:type"
},
{
"kind": "Content",
Expand All @@ -812,7 +794,7 @@
"name": "formatDateTime",
"variableTypeTokenRange": {
"startIndex": 1,
"endIndex": 10
"endIndex": 8
}
},
{
Expand Down Expand Up @@ -848,17 +830,8 @@
},
{
"kind": "Reference",
"text": "Temporal.ToStringPrecisionOptions",
"canonicalReference": "!Temporal.ToStringPrecisionOptions:type"
},
{
"kind": "Content",
"text": " & "
},
{
"kind": "Reference",
"text": "Temporal.ShowCalendarOption",
"canonicalReference": "!Temporal.ShowCalendarOption:type"
"text": "Temporal.ZonedDateTimeToStringOptions",
"canonicalReference": "!Temporal.ZonedDateTimeToStringOptions:type"
},
{
"kind": "Content",
Expand All @@ -871,7 +844,7 @@
"name": "formatDateTimeISO",
"variableTypeTokenRange": {
"startIndex": 1,
"endIndex": 10
"endIndex": 8
}
},
{
Expand Down Expand Up @@ -992,17 +965,8 @@
},
{
"kind": "Reference",
"text": "Temporal.ToStringPrecisionOptions",
"canonicalReference": "!Temporal.ToStringPrecisionOptions:type"
},
{
"kind": "Content",
"text": " & "
},
{
"kind": "Reference",
"text": "Temporal.ShowCalendarOption",
"canonicalReference": "!Temporal.ShowCalendarOption:type"
"text": "Temporal.ZonedDateTimeToStringOptions",
"canonicalReference": "!Temporal.ZonedDateTimeToStringOptions:type"
},
{
"kind": "Content",
Expand All @@ -1015,7 +979,7 @@
"name": "formatTime",
"variableTypeTokenRange": {
"startIndex": 1,
"endIndex": 10
"endIndex": 8
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This package is part of the <b>⚡storm-stack</b> monorepo. The storm-stack pack

<h3 align="center">💻 Visit <a href="https://stormsoftware.org" target="_blank">stormsoftware.org</a> to stay up to date with this developer</h3><br />

[![Version](https://img.shields.io/badge/version-1.2.3-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Version](https://img.shields.io/badge/version-1.2.4-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with docusaurus](https://img.shields.io/badge/documented_with-docusaurus-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://docusaurus.io/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)

<h3 align="center" bold="true">⚠️ <b>Attention</b> ⚠️ This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />
Expand Down
2 changes: 1 addition & 1 deletion packages/date-time/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This package is part of the <b>⚡storm-stack</b> monorepo. The storm-stack pack

<h3 align="center">💻 Visit <a href="https://stormsoftware.org" target="_blank">stormsoftware.org</a> to stay up to date with this developer</h3><br />

[![Version](https://img.shields.io/badge/version-1.4.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Version](https://img.shields.io/badge/version-1.4.3-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with docusaurus](https://img.shields.io/badge/documented_with-docusaurus-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://docusaurus.io/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)

<h3 align="center" bold="true">⚠️ <b>Attention</b> ⚠️ This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />
Expand Down
2 changes: 1 addition & 1 deletion packages/errors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This package is part of the <b>⚡storm-stack</b> monorepo. The storm-stack pack

<h3 align="center">💻 Visit <a href="https://stormsoftware.org" target="_blank">stormsoftware.org</a> to stay up to date with this developer</h3><br />

[![Version](https://img.shields.io/badge/version-1.4.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Version](https://img.shields.io/badge/version-1.4.3-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with docusaurus](https://img.shields.io/badge/documented_with-docusaurus-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://docusaurus.io/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)

<h3 align="center" bold="true">⚠️ <b>Attention</b> ⚠️ This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />
Expand Down
2 changes: 1 addition & 1 deletion packages/file-system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This package is part of the <b>⚡storm-stack</b> monorepo. The storm-stack pack

<h3 align="center">💻 Visit <a href="https://stormsoftware.org" target="_blank">stormsoftware.org</a> to stay up to date with this developer</h3><br />

[![Version](https://img.shields.io/badge/version-1.6.3-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Version](https://img.shields.io/badge/version-1.6.4-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with docusaurus](https://img.shields.io/badge/documented_with-docusaurus-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://docusaurus.io/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)

<h3 align="center" bold="true">⚠️ <b>Attention</b> ⚠️ This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />
Expand Down
2 changes: 1 addition & 1 deletion packages/jotai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This package is part of the <b>⚡storm-stack</b> monorepo. The storm-stack pack

<h3 align="center">💻 Visit <a href="https://stormsoftware.org" target="_blank">stormsoftware.org</a> to stay up to date with this developer</h3><br />

[![Version](https://img.shields.io/badge/version-1.1.2-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Version](https://img.shields.io/badge/version-1.1.3-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with docusaurus](https://img.shields.io/badge/documented_with-docusaurus-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://docusaurus.io/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)

<h3 align="center" bold="true">⚠️ <b>Attention</b> ⚠️ This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />
Expand Down
2 changes: 1 addition & 1 deletion packages/logging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This package is part of the <b>⚡storm-stack</b> monorepo. The storm-stack pack

<h3 align="center">💻 Visit <a href="https://stormsoftware.org" target="_blank">stormsoftware.org</a> to stay up to date with this developer</h3><br />

[![Version](https://img.shields.io/badge/version-1.5.3-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Version](https://img.shields.io/badge/version-1.5.4-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with docusaurus](https://img.shields.io/badge/documented_with-docusaurus-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://docusaurus.io/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)

<h3 align="center" bold="true">⚠️ <b>Attention</b> ⚠️ This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />
Expand Down
19 changes: 11 additions & 8 deletions packages/logging/src/utilities/get-transports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,20 +158,21 @@ Message: {msg}
logPath,
formatDate().replaceAll("/", "-").replaceAll(" ", "-"),
`${
loggingConfig.fileName
? loggingConfig.fileName + "-"
: EMPTY_STRING
(loggingConfig.fileName ? loggingConfig.fileName : "storm") +
"-"
}${formatDateTime()
.replaceAll("/", "-")
.replaceAll(" ", "-")
.replaceAll(":", "-")}.${
.replaceAll(":", "-")
.replaceAll(".", "-")}.${
loggingConfig.fileExtension
? loggingConfig.fileExtension.replaceAll(".", EMPTY_STRING)
: "log"
}}`
),
minLength: 4096,
sync: false
sync: false,
mkdir: true
})
}
},
Expand All @@ -188,17 +189,19 @@ Message: {msg}
config.extensions.logging.fileName
? config.extensions.logging.fileName + "-"
: EMPTY_STRING
}-error-${formatDateTime()
}error-${formatDateTime()
.replaceAll("/", "-")
.replaceAll(" ", "-")
.replaceAll(":", "-")}.${
.replaceAll(":", "-")
.replaceAll(".", "-")}.${
loggingConfig.fileExtension
? loggingConfig.fileExtension.replaceAll(".", EMPTY_STRING)
: "log"
}}`
),
minLength: 4096,
sync: false
sync: false,
mkdir: true
})
}
}
Expand Down

0 comments on commit df62ea7

Please sign in to comment.