0.0.4 • Published 5 years ago

@yamashiro/logger v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
5 years ago

Logger Discord

Logger utility for Yamashiro

Creating Plugins

// MyPlugin.ts
import { Plugin, Logger } from '@yamashiro/logger';
export default class MyPlugin extends Plugin {
    constructor(logger: Logger) {
        super(logger, 'my');
    }

    write(level: string, message: string) {
        process.stdout.write('idk why would you use this? logging in the terminal already exists.');
    }
}

// main.ts
import { Logger } from '@yamashiro/logger';
import MyPlugin from 'path/to/plugin';

const logger = new Logger({
    name: 'main',
    format: (date, level) => `${date} [${level.toUpperCase()}] >>`,
    process: process
});

logger.use(new MyPlugin(logger));
logger.info('yeet'); // =>
// idk why would you use this? logging in the terminal already exists.
// [00:00:00] [INFO] >> yeet

LICENSE

@yamashiro/logger is made by auguwu and released under the MIT license

Copyright (c) 2019 August

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago