Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
kamaki
Commits
7637d600
Commit
7637d600
authored
May 10, 2013
by
Stavros Sachtouris
Browse files
Move logger module to kamaki.cli
parent
c4d51ec9
Changes
3
Hide whitespace changes
Inline
Side-by-side
kamaki/cli/__init__.py
View file @
7637d600
...
...
@@ -40,7 +40,7 @@ from kamaki.cli.argument import ArgumentParseManager
from
kamaki.cli.history
import
History
from
kamaki.cli.utils
import
print_dict
,
red
,
magenta
,
yellow
from
kamaki.cli.errors
import
CLIError
from
kamaki
import
logger
from
kamaki
.cli
import
logger
_help
=
False
_debug
=
False
...
...
@@ -384,9 +384,7 @@ def main():
log_file
=
parser
.
arguments
[
'config'
].
get
(
'global'
,
'log_file'
)
if
log_file
:
from
kamaki.logger
import
set_log_filename
set_log_filename
(
log_file
)
logger
.
set_log_filename
(
log_file
)
global
filelog
filelog
=
logger
.
add_file_logger
(
__name__
.
split
(
'.'
)[
0
])
filelog
.
info
(
'Logging location: %s'
%
logger
.
get_log_filename
())
...
...
kamaki/cli/argument.py
View file @
7637d600
...
...
@@ -34,11 +34,11 @@
from
kamaki.cli.config
import
Config
from
kamaki.cli.errors
import
CLISyntaxError
,
raiseCLIError
from
kamaki.cli.utils
import
split_input
from
kamaki.logger
import
get_logger
from
datetime
import
datetime
as
dtm
from
time
import
mktime
from
logging
import
getLogger
from
argparse
import
ArgumentParser
,
ArgumentError
from
argparse
import
RawDescriptionHelpFormatter
...
...
@@ -52,7 +52,7 @@ except ImportError:
# progress not installed - pls, pip install progress
pass
log
=
get
_l
ogger
(
'kamaki.cli'
)
log
=
get
L
ogger
(
__name__
)
class
Argument
(
object
):
...
...
@@ -354,7 +354,7 @@ class ProgressBarArgument(FlagArgument):
try
:
KamakiProgressBar
except
NameError
:
log
.
debu
g
(
'WARNING: no progress bar functionality'
)
log
.
warnin
g
(
'WARNING: no progress bar functionality'
)
def
clone
(
self
):
"""Get a modifiable copy of this bar"""
...
...
kamaki/logger.py
→
kamaki/
cli/
logger.py
View file @
7637d600
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment