• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

danbilokha / covid19liveupdates / 1b7f2ba2bceb3035e7bd6a12e70437de495f81c7-PR-83

pending completion
1b7f2ba2bceb3035e7bd6a12e70437de495f81c7-PR-83

Pull #83

github

GitHub
Merge 660decb85 into f5f4e8b32
Pull Request #83: add user to firebase db on start command

71 of 449 branches covered (15.81%)

Branch coverage included in aggregate %.

48 of 123 new or added lines in 16 files covered. (39.02%)

7 existing lines in 5 files now uncovered.

437 of 925 relevant lines covered (47.24%)

0.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.88
/server/src/utils/logger.ts
1
import * as winston from 'winston';
1✔
2
import { Loggly } from 'winston-loggly-bulk';
1✔
3
import environment from '../environments/environment';
1✔
4
import { LogLevel, LogCategory } from '../models/constants';
1✔
5

6
if (environment.LOGGLY_TOKEN) {
1!
7
    winston.add(
×
8
        new Loggly({
9
            token: environment.LOGGLY_TOKEN,
10
            subdomain: environment.LOGGLY_SUBDOMAIN,
11
            tags: environment.LOGGLY_TAGS,
12
            json: true,
13
        })
14
    );
15
}
16

17
export const logger = {
1✔
18
    log(severity: string, message: any, type?: LogCategory, chatId?: number) {
NEW
19
        if (typeof message === 'string') {
×
NEW
20
            message = {
×
21
                message,
22
            };
23
        }
NEW
24
        if (chatId !== undefined) {
×
NEW
25
            message.chatId = chatId;
×
26
        }
NEW
27
        if (type !== undefined) {
×
NEW
28
            message.type = type;
×
29
        }
30
        winston.log(severity, message);
×
31
        if (!environment.IsProduction()) {
×
32
            // tslint:disable-next-line:no-console
33
            console.log(severity, message);
×
34
        }
35
    },
36
    error(message: any, error: Error, type?: LogCategory, chatId?: number) {
NEW
37
        if (typeof message === 'string') {
×
NEW
38
            message = {
×
39
                message,
40
            };
41
        }
NEW
42
        message.error = {
×
43
            message: error.message,
44
            stack: error.stack,
45
            name: error.name,
46
        };
NEW
47
        this.log(LogLevel.Error, message, type, chatId);
×
48
    },
49
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc