@8select/strulo
Advanced tools
Comparing version 0.4.1 to 0.5.0
module.exports = { | ||
extends: ['8select'], | ||
extends: ['8select-flow'], | ||
} |
# Change Log | ||
## [0.5.0](https://github.com/8select/strulo/tree/0.5.0) (2017-11-22) | ||
[Full Changelog](https://github.com/8select/strulo/compare/0.4.1...0.5.0) | ||
**Fixed bugs:** | ||
- fix flow-types [\#25](https://github.com/8select/strulo/pull/25) ([jbreckel](https://github.com/jbreckel)) | ||
## [0.4.1](https://github.com/8select/strulo/tree/0.4.1) (2017-11-22) | ||
@@ -4,0 +11,0 @@ [Full Changelog](https://github.com/8select/strulo/compare/0.4.0...0.4.1) |
import { getLevelName } from './log-levels'; | ||
export var formatMessage = function formatMessage(level, message) { | ||
@@ -4,0 +5,0 @@ var logMessage = { |
{ | ||
"name": "@8select/strulo", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "Log messages in a structured format.", | ||
@@ -9,2 +9,3 @@ "main": "lib/index.js", | ||
"prepush": "./scripts/prepush.sh", | ||
"lint": "eslint --ext js .", | ||
"test": "DEBUG=DEBUG,INFO,ERROR jest", | ||
@@ -39,3 +40,3 @@ "build": "npm run build:lib && npm run build:flow", | ||
"eslint": "^4.9.0", | ||
"eslint-config-8select": "^1.0.0", | ||
"eslint-config-8select-flow": "^1.0.1", | ||
"flow-bin": "^0.57.3", | ||
@@ -42,0 +43,0 @@ "flow-copy-source": "^1.2.1", |
@@ -7,26 +7,29 @@ // @flow | ||
import type { LogLevel } from './log-levels' | ||
import type { Message } from './message' | ||
const logFunctions = Object.keys(logLevels).reduce(buildLogFunctionPerLogLevel, {}) | ||
export const debug = (message: string): void => { | ||
export const debug = (message: Message): void => { | ||
logFunctions.debug(message) | ||
} | ||
export const info = (message: string): void => { | ||
export const info = (message: Message): void => { | ||
logFunctions.info(message) | ||
} | ||
export const notice = (message: string): void => { | ||
export const notice = (message: Message): void => { | ||
logFunctions.notice(message) | ||
} | ||
export const warning = (message: string): void => { | ||
export const warning = (message: Message): void => { | ||
logFunctions.warning(message) | ||
} | ||
export const error = (message: string): void => { | ||
export const error = (message: Message): void => { | ||
logFunctions.error(message) | ||
} | ||
export const critical = (message: string): void => { | ||
export const critical = (message: Message): void => { | ||
logFunctions.critical(message) | ||
} | ||
export const alert = (message: string): void => { | ||
export const alert = (message: Message): void => { | ||
logFunctions.alert(message) | ||
} | ||
export const emergency = (message: string): void => { | ||
export const emergency = (message: Message): void => { | ||
logFunctions.emergency(message) | ||
@@ -48,3 +51,3 @@ } | ||
return function(message: string): void { | ||
return function(message: Message): void { | ||
logger(formatMessage(level, message)) | ||
@@ -51,0 +54,0 @@ } |
// @flow | ||
import { getLevelName } from './log-levels' | ||
import type { LogLevel, LogLevelName } from './log-levels' | ||
export type Message = string | Object | ||
type LogMessage = { | ||
message: string, | ||
message: Message, | ||
level: LogLevel, | ||
@@ -12,3 +15,3 @@ level_name: LogLevelName, | ||
export const formatMessage = (level: LogLevel, message: string): string => { | ||
export const formatMessage = (level: LogLevel, message: Message): string => { | ||
const logMessage: LogMessage = { | ||
@@ -15,0 +18,0 @@ message, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20580
253