Skip to content

Commit 2a703d6

Browse files
committed
Move LOG_* and LEV_* defs out of constants.rb...
1 parent f2a608b commit 2a703d6

File tree

3 files changed

+61
-64
lines changed

3 files changed

+61
-64
lines changed

lib/rex/constants.rb

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,5 @@
11
# -*- coding: binary -*-
22

3-
#
4-
# Log severities
5-
#
6-
LOG_ERROR = 'error'
7-
LOG_DEBUG = 'debug'
8-
LOG_INFO = 'info'
9-
LOG_WARN = 'warn'
10-
LOG_RAW = 'raw'
11-
12-
##
13-
#
14-
# Log levels
15-
#
16-
##
17-
18-
#
19-
# LEV_0 - Default
20-
#
21-
# This log level is the default log level if none is specified. It should be
22-
# used when a log message should always be displayed when logging is enabled.
23-
# Very few log messages should occur at this level aside from necessary
24-
# information logging and error/warning logging. Debug logging at level zero
25-
# is not advised.
26-
#
27-
LEV_0 = 0
28-
29-
#
30-
# LEV_1 - Extra
31-
#
32-
# This log level should be used when extra information may be needed to
33-
# understand the cause of an error or warning message or to get debugging
34-
# information that might give clues as to why something is happening. This
35-
# log level should be used only when information may be useful to understanding
36-
# the behavior of something at a basic level. This log level should not be
37-
# used in an exhaustively verbose fashion.
38-
#
39-
LEV_1 = 1
40-
41-
#
42-
# LEV_2 - Verbose
43-
#
44-
# This log level should be used when verbose information may be needed to
45-
# analyze the behavior of the framework. This should be the default log
46-
# level for all detailed information not falling into LEV_0 or LEV_1.
47-
# It is recommended that this log level be used by default if you are
48-
# unsure.
49-
#
50-
LEV_2 = 2
51-
52-
#
53-
# LEV_3 - Insanity
54-
#
55-
# This log level should contain very verbose information about the
56-
# behavior of the framework, such as detailed information about variable
57-
# states at certain phases including, but not limited to, loop iterations,
58-
# function calls, and so on. This log level will rarely be displayed,
59-
# but when it is the information provided should make it easy to analyze
60-
# any problem.
61-
#
62-
LEV_3 = 3
63-
64-
653
#
664
# Architecture constants
675
#

lib/rex/logging.rb

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,64 @@
11
# -*- coding: binary -*-
22

3-
require 'rex/constants' # for LEV_'s
3+
#
4+
# Log severities
5+
#
6+
LOG_ERROR = 'error'
7+
LOG_DEBUG = 'debug'
8+
LOG_INFO = 'info'
9+
LOG_WARN = 'warn'
10+
LOG_RAW = 'raw'
11+
12+
##
13+
#
14+
# Log levels
15+
#
16+
##
17+
18+
#
19+
# LEV_0 - Default
20+
#
21+
# This log level is the default log level if none is specified. It should be
22+
# used when a log message should always be displayed when logging is enabled.
23+
# Very few log messages should occur at this level aside from necessary
24+
# information logging and error/warning logging. Debug logging at level zero
25+
# is not advised.
26+
#
27+
LEV_0 = 0
28+
29+
#
30+
# LEV_1 - Extra
31+
#
32+
# This log level should be used when extra information may be needed to
33+
# understand the cause of an error or warning message or to get debugging
34+
# information that might give clues as to why something is happening. This
35+
# log level should be used only when information may be useful to understanding
36+
# the behavior of something at a basic level. This log level should not be
37+
# used in an exhaustively verbose fashion.
38+
#
39+
LEV_1 = 1
40+
41+
#
42+
# LEV_2 - Verbose
43+
#
44+
# This log level should be used when verbose information may be needed to
45+
# analyze the behavior of the framework. This should be the default log
46+
# level for all detailed information not falling into LEV_0 or LEV_1.
47+
# It is recommended that this log level be used by default if you are
48+
# unsure.
49+
#
50+
LEV_2 = 2
51+
52+
#
53+
# LEV_3 - Insanity
54+
#
55+
# This log level should contain very verbose information about the
56+
# behavior of the framework, such as detailed information about variable
57+
# states at certain phases including, but not limited to, loop iterations,
58+
# function calls, and so on. This log level will rarely be displayed,
59+
# but when it is the information provided should make it easy to analyze
60+
# any problem.
61+
#
62+
LEV_3 = 3
63+
464
require 'rex/logging/log_dispatcher'

lib/rex/logging/log_sink.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: binary -*-
2-
require 'rex/constants'
32

43
module Rex
54
module Logging

0 commit comments

Comments
 (0)