https://github.com/userfrosting/ts-log-adapter-gulplog
An adapter for the ts-log interface that pushes logging to gulplog with optional arguments JSON encoded.
https://github.com/userfrosting/ts-log-adapter-gulplog
Last synced: about 1 year ago
JSON representation
An adapter for the ts-log interface that pushes logging to gulplog with optional arguments JSON encoded.
- Host: GitHub
- URL: https://github.com/userfrosting/ts-log-adapter-gulplog
- Owner: userfrosting
- License: mit
- Created: 2020-04-23T04:08:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-15T09:26:49.000Z (about 1 year ago)
- Last Synced: 2025-04-15T10:33:59.667Z (about 1 year ago)
- Language: TypeScript
- Size: 3.43 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# ts-log-adapter-gulplog
| Branch | Status |
| ------ | ------ |
| master | [](https://github.com/userfrosting/ts-log-adapter-gulplog/actions?query=branch:master+workflow:"Continuous+Integration") [](https://codecov.io/gh/userfrosting/ts-log-adapter-gulplog/branch/master) |
An adapter for the ts-log interface that pushes logging to gulplog.
Before being passed to `gulplog`, the message optional arguments will be processed to ensure proper logging. The `trace` log level does not map across and will be directed to `GulpLog.debug` with `TRACE: ` prefixed to logging.
## Install
```bash
npm i -D @userfrosting/ts-log-adapter-gulplog
```
## Usage
```js
// gulpfile.mjs
import { GulpLogLogger } from "@userfrosting/ts-log-adapter-gulplog";
import { src, dest } from "gulp";
import AssetBundler from "@userfrosting/gulp-bundle-assets";
import cleanCss from "gulp-clean-css";
import concatCss from "gulp-concat-css";
import concatJs from "gulp-concat-js";
import uglify from "gulp-uglify";
export function bundle() {
const config = {
bundle: {
example: {
scripts: [
"foo.js",
"bar.js"
],
styles: [
"foo.css",
"bar.css"
]
}
},
logger: new GulpLogLogger(),
};
const joiner = {
Scripts(bundleStream, name) {
return bundleStream
.pipe(concatJs(name + ".js"))// example.js
.pipe(uglify());
},
Styles(bundleStream, name) {
return bundleStream
.pipe(concatCss(name + ".css"))// example.css
.pipe(cleanCss());
}
};
return src("src/**")
.pipe(new AssetBundler(config, joiner))
.pipe(dest("public/assets/"));
}
```
```bash
$ gulp bundle
```
## API
See [docs/api](./docs/api/index.md).
## License
[MIT](LICENSE)
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md).