|
1 |
| -import { F, always, bind, equals, findIndex, gte, ifElse, partial, pickAll } from 'ramda' |
| 1 | +import { F, always, equals, findIndex, gte, ifElse, pickAll } from 'ramda' |
2 | 2 |
|
3 | 3 | /**
|
4 | 4 | * @type Logger = {
|
@@ -36,40 +36,28 @@ const loggerHead = type => `[${(new Date()).toISOString()}] ${type.toUpperCase()
|
36 | 36 | // error :: (String, Output) -> Function
|
37 | 37 | const error = (level, output) => ifElse(
|
38 | 38 | level => shouldPrintLog(level, LEVEL_ERROR),
|
39 |
| - () => partial( |
40 |
| - bind(output.error, output), |
41 |
| - [loggerHead(LEVEL_ERROR)], |
42 |
| - ), |
| 39 | + () => (...args) => output.error(loggerHead(LEVEL_ERROR), ...args), |
43 | 40 | always(F),
|
44 | 41 | )(level)
|
45 | 42 |
|
46 | 43 | // warn :: (String, Output) -> Function
|
47 | 44 | const warn = (level, output) => ifElse(
|
48 | 45 | level => shouldPrintLog(level, LEVEL_WARN),
|
49 |
| - () => partial( |
50 |
| - bind(output.warn, output), |
51 |
| - [loggerHead(LEVEL_WARN)], |
52 |
| - ), |
| 46 | + () => (...args) => output.warn(loggerHead(LEVEL_WARN), ...args), |
53 | 47 | always(F),
|
54 | 48 | )(level)
|
55 | 49 |
|
56 | 50 | // info :: (String, Output) -> Function
|
57 | 51 | const info = (level, output) => ifElse(
|
58 | 52 | level => shouldPrintLog(level, LEVEL_INFO),
|
59 |
| - () => partial( |
60 |
| - bind(output.info, output), |
61 |
| - [loggerHead(LEVEL_INFO)], |
62 |
| - ), |
| 53 | + () => (...args) => output.info(loggerHead(LEVEL_INFO), ...args), |
63 | 54 | always(F),
|
64 | 55 | )(level)
|
65 | 56 |
|
66 | 57 | // debug :: (String, Output) -> Function
|
67 | 58 | const debug = (level, output) => ifElse(
|
68 | 59 | level => shouldPrintLog(level, LEVEL_DEBUG),
|
69 |
| - () => partial( |
70 |
| - bind(output.log, output), |
71 |
| - [loggerHead(LEVEL_DEBUG)], |
72 |
| - ), |
| 60 | + () => (...args) => output.log(loggerHead(LEVEL_DEBUG), ...args), |
73 | 61 | always(F),
|
74 | 62 | )(level)
|
75 | 63 |
|
|
0 commit comments