@@ -25,7 +25,7 @@ start: func [
25
25
;** Note ** We need to make this work for lower boot levels too!
26
26
27
27
;-- DEBUG: enable these lines for debug or related testing
28
- loud-print ["Starting... boot level:" boot-level]
28
+ log /debug 'REBOL ["Starting... boot level:" boot-level]
29
29
;trace 1
30
30
;crash-here ; test error handling (undefined word)
31
31
@@ -41,19 +41,23 @@ start: func [
41
41
system/build/compiler: ver/6
42
42
system/build/date: ver/7
43
43
44
+ if flags/verbose [system/options/log/rebol: 3 ] ;maximum log output for system messages
45
+
44
46
;-- Print minimal identification banner if needed:
45
47
if all [
46
48
not quiet
47
49
any [flags/verbose flags/usage flags/help ]
48
50
][
49
- boot-print boot-banner ; basic boot banner only
51
+ ; basic boot banner only
52
+ prin "^/ "
53
+ print boot-banner: form ver
50
54
]
51
55
if any [do-arg script] [quiet: true]
52
56
53
57
;-- Set up option/paths for /path, /boot, /home, and script path (for SECURE):
54
- loud-print ["Initial path:" path]
55
- loud-print ["Initial boot:" boot]
56
- loud-print ["Initial home:" home] ; always NONE at this state!
58
+ log /more 'REBOL ["Initial path:" path]
59
+ log /more 'REBOL ["Initial boot:" boot]
60
+ ;log/more 'REBOL ["Initial home:" home] ; always NONE at this state!
57
61
;- 1. /path - that is current directory (resolved from C as a part of args processing)
58
62
; nothing to do here
59
63
;- 2. /boot - path to executable (must handle relative paths)
@@ -69,7 +73,7 @@ start: func [
69
73
]
70
74
]
71
75
if boot <> tmp [
72
- loud-print "Path to executable was not resolved!"
76
+ log /error 'REBOL "Path to executable was not resolved!"
73
77
boot: none
74
78
]
75
79
]
@@ -110,7 +114,7 @@ start: func [
110
114
; For example: mods, plus, host, and full
111
115
if boot-level [
112
116
load-boot-exts
113
- loud-print "Init mezz plus..."
117
+ log /debug 'REBOL "Init mezz plus..."
114
118
115
119
do bind-lib boot-mezz
116
120
boot-mezz: 'done
@@ -128,7 +132,7 @@ start: func [
128
132
]
129
133
130
134
if boot-host [
131
- loud-print "Init host code..."
135
+ log /debug 'REBOL "Init host code..."
132
136
;probe load boot-host
133
137
do load boot-host
134
138
boot-host: none
@@ -138,7 +142,7 @@ start: func [
138
142
flags/verbose
139
143
not any [quiet script do-arg]
140
144
][
141
- boot- print boot-banner
145
+ print boot-banner
142
146
]
143
147
]
144
148
@@ -163,24 +167,25 @@ start: func [
163
167
;-- Evaluate rebol.reb script:
164
168
;@@ https://github.com/Oldes/Rebol-issues/issues/706
165
169
tmp: first split-path boot
166
- loud-print ["Checking for rebol.reb file in" tmp]
170
+ log /info 'REBOL ["Checking for rebol.reb file in" tmp]
167
171
168
172
if all [
169
173
#"/" = first tmp ; only if we know absolute path
170
174
exists? tmp/rebol.reb
171
175
][
172
- do tmp/rebol.reb
176
+ try /except [ do tmp/rebol.reb ][log /error 'REBOL system /state/last-error ]
173
177
]
174
178
175
179
;-- Make the user's global context:
176
180
tmp: make object! 320
177
- append tmp reduce ['system :system 'lib-local :tmp ]
181
+ append tmp reduce ['REBOL :system 'lib-local :tmp ]
178
182
system/contexts/user: tmp
179
183
180
- loud-print ["Checking for user.reb file in" home]
181
- if exists? home/user.reb [do home/user.reb ]
184
+ log/info 'REBOL ["Checking for user.reb file in" home]
185
+ if exists? home/user.reb [
186
+ try /except [do home/user.reb ][log/error 'REBOL system/state/last-error ]
187
+ ]
182
188
183
- boot-print ""
184
189
185
190
;if :lib/secure [protect-system-object]
186
191
@@ -194,7 +199,7 @@ start: func [
194
199
]
195
200
196
201
;-- Evaluate script argument?
197
- either file? script [
202
+ if file? script [
198
203
; !!! Would be nice to use DO for this section. !!!
199
204
; NOTE: We can't use DO here because it calls the code it does with CATCH/quit
200
205
; and we shouldn't catch QUIT in the top-level script, we should just quit.
@@ -203,7 +208,7 @@ start: func [
203
208
; /path dir is where our script gets started.
204
209
change-dir first script-path
205
210
either exists? second script-path [
206
- boot-print ["Evaluating:" script]
211
+ log /info 'REBOL ["Evaluating:" script]
207
212
code: load/header/type second script-path 'unbound
208
213
; update system/script (Make into a function?)
209
214
system/script: make system/standard/script [
@@ -225,8 +230,6 @@ start: func [
225
230
] [
226
231
cause-error 'access 'no-script script
227
232
]
228
- ][
229
- boot-print boot-help
230
233
]
231
234
232
235
exit
0 commit comments