-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
51 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
crystal 0.32.1 | ||
crystal 0.34.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: cli | ||
version: 0.3.3 | ||
version: 0.4.0 | ||
|
||
authors: | ||
- Mitchell Stanley <[email protected]> | ||
|
@@ -8,7 +8,7 @@ targets: | |
cli2: | ||
main: src/cli.cr | ||
|
||
crystal: < 0.33 | ||
crystal: 0.34.0 | ||
|
||
license: MIT | ||
|
||
|
@@ -17,7 +17,7 @@ dependencies: | |
github: jwaldrip/admiral.cr | ||
crest: | ||
github: mamantoha/crest | ||
version: ~> 0.22.0 | ||
version: ~> 0.25.0 | ||
toml: | ||
github: crystal-community/toml.cr | ||
branch: master | ||
|
@@ -38,4 +38,4 @@ dependencies: | |
development_dependencies: | ||
ameba: | ||
github: veelenga/ameba | ||
version: ~> 0.11.0 | ||
version: ~> 0.12.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +0,0 @@ | ||
require "logger" | ||
|
||
module SniplineCli | ||
module Services | ||
# Log is a wrapper around the Crystal `Logger`. | ||
# | ||
# Example Usage | ||
# | ||
# ```crystal | ||
# log = SniplineCli.log | ||
# config = SniplineCli.config | ||
# log.info("Looking through file #{config.get("general.file")}") | ||
# ``` | ||
# | ||
# The output level can then be specified at run-time. | ||
# | ||
# ```bash | ||
# env LOG_LEVEL=WARN snipcli sync | ||
# ``` | ||
class Log | ||
# Constant that creates a fresh version of itself - for use with self.log. | ||
INSTANCE = Log.new | ||
|
||
property logger : Logger | ||
|
||
def initialize | ||
ENV["LOG_LEVEL"] ||= "WARN" | ||
@logger = Logger.new(STDOUT, level: (ENV["LOG_LEVEL"] == "DEBUG") ? Logger::DEBUG : Logger::WARN) | ||
end | ||
|
||
# The static convenience method for retreiving the Log class instance without regenerating it. | ||
def self.log | ||
Log::INSTANCE | ||
end | ||
|
||
macro define_methods(names) | ||
{% for name in names %} | ||
def {{name}}(message : String) | ||
@logger.{{name}}(message) | ||
end | ||
{% end %} | ||
end | ||
|
||
define_methods([debug, warn, info, fatal]) | ||
end | ||
end | ||
end | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters