Skip to content

Commit

Permalink
Correct logging.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Sygus committed Jan 11, 2012
1 parent 74118e4 commit 4b7391e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ Dependencies :
* iptables
* python-bitarray
* python-pyasn1
* python-lxml
* python-dev
* libjs-sphinxdoc
* python-sphinx

or, on Debian-like operating systems :

$ sudo apt-get install tcpdump python python-ptrace nfqueue-bindings-python \
python-hachoir-subfile python-matplotlib python-dpkt strace lsof iptables \
python-pcapy python-bitarray python-pyasn1 python-dev
python-pcapy python-bitarray python-pyasn1 python-dev python-lxml \
libjs-sphinxdoc python-sphinx

And then,

Expand All @@ -69,10 +73,6 @@ $ ./netzob
[************************] 4. Documentation [*************************]
[*******************************************************************************]

Dependency for documentation building :

* python-sphinx

Documentation generation :

The folder "doc/documentation" contains the documentation of Netzob in sphynx
Expand Down
22 changes: 22 additions & 0 deletions resources/static/defaults/logging.conf.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[loggers]
keys=root

[handlers]
keys=consoleHandler

[formatters]
keys=simpleFormatter

[logger_root]
level=INFO
handlers=consoleHandler

[handler_consoleHandler]
class=StreamHandler
level=INFO
formatter=simpleFormatter
args=(sys.stdout,)

[formatter_simpleFormatter]
format=[%(threadName)s]%(asctime)s - %(module)s - %(levelname)s - %(message)s
datefmt=
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
('share/icons/hicolor/48x48/apps/', ["resources/static/icons/48x48/netzob.png"]),
('share/icons/hicolor/64x64/apps/', ["resources/static/icons/64x64/netzob.png"]),
('share/netzob/defaults', ["resources/static/defaults/repository.xml.default"]),
('share/netzob/defaults', ["resources/static/defaults/logging.conf.default"]),
('share/netzob/xsds/0.1/', ["resources/static/xsds/0.1/Workspace.xsd",
"resources/static/xsds/0.1/Project.xsd",
"resources/static/xsds/0.1/common.xsd"]),
Expand Down
9 changes: 9 additions & 0 deletions src/netzob/Common/Workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def createWorkspace(name, path):
tracesPath = os.path.join(path, "traces")
projectsPath = os.path.join(path, "projects")
prototypesPath = os.path.join(path, "prototypes")
loggingPath = os.path.join(path, "logging")
pathOfLogging = os.path.join(path, "logging/logging.conf")

# we create a "traces" directory if it doesn't yet exist
Expand All @@ -205,6 +206,14 @@ def createWorkspace(name, path):
from netzob.Common.ResourcesConfiguration import ResourcesConfiguration
staticRepositoryPath = os.path.join(os.path.join(ResourcesConfiguration.getStaticResources(), "defaults"), "repository.xml.default")
shutil.copy(staticRepositoryPath, os.path.join(prototypesPath, "repository.xml"))

# we create the "logging" directory if it doesn't yet exist
if not os.path.isdir(loggingPath) :
os.mkdir(loggingPath)
# we upload in it the default repository file
from netzob.Common.ResourcesConfiguration import ResourcesConfiguration
staticLoggingPath = os.path.join(os.path.join(ResourcesConfiguration.getStaticResources(), "defaults"), "logging.conf.default")
shutil.copy(staticLoggingPath, os.path.join(loggingPath, "logging.conf"))

workspace = Workspace(name, datetime.datetime.now(), path, tracesPath, pathOfLogging, prototypesPath)
workspace.saveConfigFile()
Expand Down

0 comments on commit 4b7391e

Please sign in to comment.